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

  • Thread starter Thread starter honestrosewater
  • Start date Start date
  • Tags Tags
    Code
Click For Summary

Discussion Overview

The discussion revolves around the behavior of the ISO-8859-1 character code for the character ö, particularly in the context of HTML encoding and rendering. Participants explore how the character is displayed when inputted and quoted in a forum environment, focusing on the implications of using character entities and the role of semicolons in their representation.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes that when quoting another's input of the character code for ö without a semicolon, the character appears correctly, raising questions about the underlying mechanism.
  • Another participant explains that the ampersand symbol is converted into its ASCII equivalent in HTML.
  • A participant points out that while PF's HTML claims to use ISO-8859-1, the behavior of the character code suggests a different interpretation, questioning why the character appears correctly when re-entered.
  • It is mentioned that the semicolon is not necessary if the character following the entity is a whitespace or end of line, which may explain the rendering behavior in certain contexts.

Areas of Agreement / Disagreement

Participants express differing views on the behavior of character encoding and rendering, with no consensus reached on the exact mechanisms at play.

Contextual Notes

The discussion highlights potential limitations in understanding how character entities are processed in HTML, particularly regarding the necessity of semicolons and the implications of different character sets.

honestrosewater
Gold Member
Messages
2,133
Reaction score
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
honestrosewater said:
What is happening?!

The ampersand symbol got converted into its ASCII equivalent in HTML.
 
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?
 
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.
 
wave,
Thanks for the info. :biggrin:
 

Similar threads

Replies
24
Views
2K
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
16K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
1
Views
4K
  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
6K