Improper text-encoding detection of webpage with Safari
-
ArcSedna
- Taschenrechner

- Beiträge: 7
- Registriert: 12.11.2012 02:52
Improper text-encoding detection of webpage with Safari
Hi.
I live in Japan, and I have a little bit of problem, regarding text-encoding of webpage.
Most of the RNA world webpage is written in UTF-8 text-encoding.
When I browse with Mozilla Firefox, the page is parsed as UTF-8 correctly.
But when I browse with Apple Safari on Mac OS X or iOS, the page is parsed as Shift-JIS, and many of the character is un-readable.
Shift-JIS is a text-encoding that is used commonly in Japanese website. My browser default text-encoding is set to Shift-JIS.
Maybe this is a Safari-side problem (bug), but when I browse yoyo@home webpage with Safari, the page is rendered in UTF-8 encoding correctly,
so I think there's something in RNA World webpage-side too.
Would you please correct the webpage so that Safari can detect text-encoding as UTF-8?
Or is there any workarounds to avoid miss-encoding the webpage?
Thank you.
I live in Japan, and I have a little bit of problem, regarding text-encoding of webpage.
Most of the RNA world webpage is written in UTF-8 text-encoding.
When I browse with Mozilla Firefox, the page is parsed as UTF-8 correctly.
But when I browse with Apple Safari on Mac OS X or iOS, the page is parsed as Shift-JIS, and many of the character is un-readable.
Shift-JIS is a text-encoding that is used commonly in Japanese website. My browser default text-encoding is set to Shift-JIS.
Maybe this is a Safari-side problem (bug), but when I browse yoyo@home webpage with Safari, the page is rendered in UTF-8 encoding correctly,
so I think there's something in RNA World webpage-side too.
Would you please correct the webpage so that Safari can detect text-encoding as UTF-8?
Or is there any workarounds to avoid miss-encoding the webpage?
Thank you.
-
Michael H.W. Weber
- Vereinsvorstand

- Beiträge: 23174
- Registriert: 07.01.2002 01:00
- Wohnort: Marpurk
Re: Improper text-encoding detection of webpage with Safari
Thanks a lot for bringing this issue to our attention. I have never heard of this problem before, but maybe Yoyo can look into this? 
Michael.
Michael.
Fördern, kooperieren und konstruieren statt fordern, konkurrieren und konsumieren.


-
yoyo
- Vereinsvorstand

- Beiträge: 8170
- Registriert: 17.12.2002 14:09
- Wohnort: Berlin
Re: Improper text-encoding detection of webpage with Safari
I have no idea how the encoding works and why the browser chooses which one.
yoyo
yoyo
-
ArcSedna
- Taschenrechner

- Beiträge: 7
- Registriert: 12.11.2012 02:52
Re: Improper text-encoding detection of webpage with Safari
Michael, yoyo, thanks for replying.
Yes, I have no idea too. Among the various pages in RNA World (top, server status, my account, etc.), some are ok, and the others are not (even if in both cases the pages contain similar number of Japanese characters).
I hope Apple Safari teams work harder to improve their text-encoding detection algorithm.
Anyway, I'll going to use Firefox instead of Safari when visiting RNA webpage.
(...and have to find some alternatives for iOS
)
Thank you again!
Yes, I have no idea too. Among the various pages in RNA World (top, server status, my account, etc.), some are ok, and the others are not (even if in both cases the pages contain similar number of Japanese characters).
I hope Apple Safari teams work harder to improve their text-encoding detection algorithm.
Anyway, I'll going to use Firefox instead of Safari when visiting RNA webpage.
(...and have to find some alternatives for iOS
Thank you again!
-
Torbjörn Klatt
- Vereinsmitglied

- Beiträge: 1333
- Registriert: 23.04.2007 21:18
- Wohnort: Bad Homburg, HR, D, Earth, Sol, Milkyway
Re: Improper text-encoding detection of webpage with Safari
Can you check on sites with broken encoding, if they have the following line in the HTML header:
Code: Alles auswählen
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">alias Bohne2k7
bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de

bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de

-
Dunuin
- Vereinsmitglied

- Beiträge: 1743
- Registriert: 23.03.2011 12:59
- Wohnort: Hamburg
Re: Improper text-encoding detection of webpage with Safari
Don't forget the header:
Code: Alles auswählen
<?php
header("Content-Type: text/html; charset=utf-8");
?>

-
Torbjörn Klatt
- Vereinsmitglied

- Beiträge: 1333
- Registriert: 23.04.2007 21:18
- Wohnort: Bad Homburg, HR, D, Earth, Sol, Milkyway
Re: Improper text-encoding detection of webpage with Safari
Which will never be seen by a visitor of the site but only the BOINC administrator while looking into the PHP scripts. But I guess, this is correctly set. Otherwise a lot more would be brokenDunuin hat geschrieben:Don't forget the header:Code: Alles auswählen
<?php header("Content-Type: text/html; charset=utf-8"); ?>
alias Bohne2k7
bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de

bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de

-
Dunuin
- Vereinsmitglied

- Beiträge: 1743
- Registriert: 23.03.2011 12:59
- Wohnort: Hamburg
Re: Improper text-encoding detection of webpage with Safari
Not the PHP-code itself but everyone can see the resulting header. And the RNA-World header is...
So there are two ways how to tell the browser which charset should be used and RNA-World only supports one of them.
If the browser is ignoring the META-tag and is only looking at the header, it won't find a defined charset and will use the browser standard.
...so the charset info is missing there.http://www.rnaworld.de/rnaworld/ hat geschrieben: HTTP/1.1 200 OK
Date: Tue, 13 Nov 2012 07:24:54 GMT
Server: Apache
X-Powered-By: PHP/5.3.3
Connection: close
Content-Type: text/html
So there are two ways how to tell the browser which charset should be used and RNA-World only supports one of them.
If the browser is ignoring the META-tag and is only looking at the header, it won't find a defined charset and will use the browser standard.

-
Torbjörn Klatt
- Vereinsmitglied

- Beiträge: 1333
- Registriert: 23.04.2007 21:18
- Wohnort: Bad Homburg, HR, D, Earth, Sol, Milkyway
Re: Improper text-encoding detection of webpage with Safari
You'r right. That should be changed. Yoyo@home is returning charset ISO-8859-1 on http://www.rechenkraft.net/yoyo and UTF-8 on http://www.rechenkraft.net/yoyo/, which is alright. Our wiki and forum are returning UTF-8 as well.
Well, this is a thing, Yoyo should be able to change.
Check with:
Well, this is a thing, Yoyo should be able to change.
Check with:
Code: Alles auswählen
curl -I http://url.to.check | grep "Content-Type"alias Bohne2k7
bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de

bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de

-
Dunuin
- Vereinsmitglied

- Beiträge: 1743
- Registriert: 23.03.2011 12:59
- Wohnort: Hamburg
Re: Improper text-encoding detection of webpage with Safari
If you don't want to add a
to every file you can also change the "php.ini".
I suppose the "default_charset" option isn't set to utf8, so its missing in the header.
Code: Alles auswählen
<?php
header("Content-Type: text/html; charset=utf-8");
?>
I suppose the "default_charset" option isn't set to utf8, so its missing in the header.

-
yoyo
- Vereinsvorstand

- Beiträge: 8170
- Registriert: 17.12.2002 14:09
- Wohnort: Berlin
Re: Improper text-encoding detection of webpage with Safari
Can You check if it is now working?ArcSedna hat geschrieben:Michael, yoyo, thanks for replying.
Yes, I have no idea too. Among the various pages in RNA World (top, server status, my account, etc.), some are ok, and the others are not (even if in both cases the pages contain similar number of Japanese characters).
I hope Apple Safari teams work harder to improve their text-encoding detection algorithm.
Anyway, I'll going to use Firefox instead of Safari when visiting RNA webpage.
(...and have to find some alternatives for iOS)
Thank you again!
The encoding in most of the project specific translations was not set or not properly set. I fixed it now.
In my test the japanese version of e.g. apps.php is now sent with an UTF8 encoding. This wasn't the case before.
yoyo
-
ArcSedna
- Taschenrechner

- Beiträge: 7
- Registriert: 12.11.2012 02:52
Re: Improper text-encoding detection of webpage with Safari
Thank you for fixing.yoyo hat geschrieben:Can You check if it is now working?
The encoding in most of the project specific translations was not set or not properly set. I fixed it now.
In my test the japanese version of e.g. apps.php is now sent with an UTF8 encoding. This wasn't the case before.
yoyo
I browsed the pages with Safari, and almost all pages look OK with UTF-8 encoding.
Server status page was shown in incorrect encoding (Shift-JIS instead of UTF-8).
Thanks again.