Improper text-encoding detection of webpage with Safari

Everything about the project RNA World
Nachricht
Autor
ArcSedna
Taschenrechner
Taschenrechner
Beiträge: 7
Registriert: 12.11.2012 02:52

Improper text-encoding detection of webpage with Safari

#1 Ungelesener Beitrag von ArcSedna » 12.11.2012 03:23

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.

Benutzeravatar
Michael H.W. Weber
Vereinsvorstand
Vereinsvorstand
Beiträge: 23174
Registriert: 07.01.2002 01:00
Wohnort: Marpurk

Re: Improper text-encoding detection of webpage with Safari

#2 Ungelesener Beitrag von Michael H.W. Weber » 12.11.2012 10:59

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? :D

Michael.
Fördern, kooperieren und konstruieren statt fordern, konkurrieren und konsumieren.

Bild Bild

Benutzeravatar
yoyo
Vereinsvorstand
Vereinsvorstand
Beiträge: 8170
Registriert: 17.12.2002 14:09
Wohnort: Berlin

Re: Improper text-encoding detection of webpage with Safari

#3 Ungelesener Beitrag von yoyo » 12.11.2012 13:56

I have no idea how the encoding works and why the browser chooses which one.
yoyo
HILF mit im Rechenkraft-WiKi, dies gibts zu tun.
Wiki - FAQ - Verein - Chat

Bild Bild

ArcSedna
Taschenrechner
Taschenrechner
Beiträge: 7
Registriert: 12.11.2012 02:52

Re: Improper text-encoding detection of webpage with Safari

#4 Ungelesener Beitrag von ArcSedna » 12.11.2012 17:05

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! :)

Torbjörn Klatt
Vereinsmitglied
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

#5 Ungelesener Beitrag von Torbjörn Klatt » 12.11.2012 18:19

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
Bild

Benutzeravatar
Dunuin
Vereinsmitglied
Vereinsmitglied
Beiträge: 1743
Registriert: 23.03.2011 12:59
Wohnort: Hamburg

Re: Improper text-encoding detection of webpage with Safari

#6 Ungelesener Beitrag von Dunuin » 13.11.2012 07:50

Don't forget the header:

Code: Alles auswählen

<?php
header("Content-Type: text/html; charset=utf-8");
?>
Bild

Torbjörn Klatt
Vereinsmitglied
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

#7 Ungelesener Beitrag von Torbjörn Klatt » 13.11.2012 08:13

Dunuin hat geschrieben:Don't forget the header:

Code: Alles auswählen

<?php
header("Content-Type: text/html; charset=utf-8");
?>
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 broken :D
alias Bohne2k7
bevorzugte Projekte: WCG, RNA World, Yoyo
Profil (RKN-Wiki) | www: torbjoern-klatt.de | Twitter: @torbjoernklatt | Diaspora*: torbjoernk@diasp.de
Bild

Benutzeravatar
Dunuin
Vereinsmitglied
Vereinsmitglied
Beiträge: 1743
Registriert: 23.03.2011 12:59
Wohnort: Hamburg

Re: Improper text-encoding detection of webpage with Safari

#8 Ungelesener Beitrag von Dunuin » 13.11.2012 08:26

Not the PHP-code itself but everyone can see the resulting header. And the RNA-World header is...
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 the charset info is missing there.

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.
Bild

Torbjörn Klatt
Vereinsmitglied
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

#9 Ungelesener Beitrag von Torbjörn Klatt » 13.11.2012 08:46

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:

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
Bild

Benutzeravatar
Dunuin
Vereinsmitglied
Vereinsmitglied
Beiträge: 1743
Registriert: 23.03.2011 12:59
Wohnort: Hamburg

Re: Improper text-encoding detection of webpage with Safari

#10 Ungelesener Beitrag von Dunuin » 13.11.2012 08:55

If you don't want to add a

Code: Alles auswählen

<?php 
header("Content-Type: text/html; charset=utf-8");
 ?>
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.
Bild

Benutzeravatar
yoyo
Vereinsvorstand
Vereinsvorstand
Beiträge: 8170
Registriert: 17.12.2002 14:09
Wohnort: Berlin

Re: Improper text-encoding detection of webpage with Safari

#11 Ungelesener Beitrag von yoyo » 13.11.2012 20:42

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! :)
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
HILF mit im Rechenkraft-WiKi, dies gibts zu tun.
Wiki - FAQ - Verein - Chat

Bild Bild

ArcSedna
Taschenrechner
Taschenrechner
Beiträge: 7
Registriert: 12.11.2012 02:52

Re: Improper text-encoding detection of webpage with Safari

#12 Ungelesener Beitrag von ArcSedna » 14.11.2012 09:29

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
Thank you for fixing.

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.

Zurück zu „RNA World Discussions (english)“