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

  • Thread starter Thread starter honestrosewater
  • Start date Start date
  • Tags Tags
    Code
AI Thread Summary
The discussion revolves around the behavior of character encoding in HTML, specifically regarding the ISO-8859-1 character code for the letter "ö." When the code &#246 is entered without a semicolon, it appears correctly as "ö" when quoted or edited, despite the absence of the semicolon. This occurs because the ampersand (&) is converted into its ASCII equivalent in HTML, and the semicolon is not strictly necessary if the following character is a whitespace or an end of line. The browser renders the entity correctly within the textarea, leading to the confusion about the semicolon requirement. Overall, the thread clarifies that the behavior is standard and not indicative of any issues with the HTML encoding system.
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:
 
Sorry if 'Profile Badge' is not the correct term. I have an MS 365 subscription and I've noticed on my Word documents the small circle with my initials in it is sometimes different in colour document to document (it's the circle at the top right of the doc, that, when you hover over it it tells you you're signed in; if you click on it you get a bit more info). Last night I had four docs with a red circle, one with blue. When I closed the blue and opened it again it was red. Today I have 3...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...

Similar threads

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