Why is the ISO-8859-1 character code not working properly for ö?

  • Thread starter honestrosewater
  • Start date
  • Tags
    Code
In summary, The ISO-8859-1 character code for ö was used without a semicolon, but when quoted, the character appeared correctly. When input from a text box, the character appears as &#246 in the html, but when editing or quoting, it appears as ö. This is because ISO-8859-1 is a superset of US-ASCII and the semicolon is not necessary if the immediate character following the entity is a white space or end of line. There is nothing strange happening.
  • #1
honestrosewater
Gold Member
2,143
6
In another thread, someone was trying to use the ISO-8859-1 character code for ö and forgot the semicolon. They wrote
&#246
and when I quoted them to point out the omission, the character magically appeared. When input from the text box, &#246 appears in the html as
& amp;#246
(no space) as expected. But when editing or quoting, it appears as ö. What is happening?!
 
Computer science news on Phys.org
  • #2
honestrosewater said:
What is happening?!

The ampersand symbol got converted into its ASCII equivalent in HTML.
 
  • #3
wave said:
The ampersand symbol got converted into its ASCII equivalent in HTML.
PF's html says it uses ISO-8859-1 not ASCII. I understand why & appears as & amp; in the html. But why does & amp;#246 appear as ö when entered the second time, presumably from the html? Does something add the semicolon to the end?
 
  • #4
honestrosewater said:
PF's html says it uses ISO-8859-1 not ASCII.

ISO-8859-1 is a superset of US-ASCII.


honestrosewater said:
But why does & amp;#246 appear as ö when entered the second time, presumably from the html? Does something add the semicolon to the end?

The semicolon is not necessary if the immediate character following the entity is a white space or end of line. Your browser will render the entity inside the textarea block, even though it doesn't have a trailing semicolon. I assure you there is nothing strange going on.
 
  • #5
wave,
Thanks for the info. :biggrin:
 

FAQ: Why is the ISO-8859-1 character code not working properly for ö?

What is the ISO-8859-1 character code?

The ISO-8859-1 character code, also known as Latin-1, is a character encoding standard that is used to represent text in various Western European languages. It is a 8-bit single-byte encoding, meaning each character is represented by 8 bits or 1 byte.

What languages are supported by the ISO-8859-1 character code?

The ISO-8859-1 character code primarily supports languages that use the Latin alphabet, such as English, French, German, Spanish, Portuguese, and many others. It also includes characters from the basic Latin character set, as well as some special characters and symbols.

How does the ISO-8859-1 character code differ from other character encodings?

The ISO-8859-1 character code is one of the oldest and most widely used character encodings, but it has several limitations. It only supports a limited number of characters, making it unsuitable for languages that require a larger character set, such as Chinese or Japanese. It also does not include characters from non-Latin alphabets.

Is the ISO-8859-1 character code still relevant today?

While the ISO-8859-1 character code was widely used in the past, it has been largely replaced by more modern character encodings, such as UTF-8. However, it is still used in some legacy systems and can be helpful for converting older text files into more modern formats.

How is the ISO-8859-1 character code used in web development?

The ISO-8859-1 character code was commonly used in web development in the early days of the internet, but it has been largely replaced by Unicode-based encodings. However, it can still be specified in HTML documents using the <meta> tag to ensure proper display of characters for older browsers or for compatibility with legacy systems.

Similar threads

Replies
3
Views
880
Replies
6
Views
3K
Replies
54
Views
5K
Replies
4
Views
4K
Replies
2
Views
5K
Replies
2
Views
1K
Replies
9
Views
2K
Back
Top