You are here: Foswiki>Tasks Web>Item8520 (05 Jul 2015, GeorgeClark)Edit Attach

Item8520: localization; bad charset definitions for non english pages (in header and meta)

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: FoswikiRender, I18N
Branches:
Reported By: BioSmoothly
Waiting For:
Last Change By: GeorgeClark
Hi, I am working on bilingual site (english and polish).I set charset to iso-8859-2 on sites with the polish language. Everything works fine when tested on Opera or Google Chrome. However on Firefox the header is not recognized properly. Firefox recognizes such html page as encoded with iso-8859-1. I don't have IE so I was unable to test on it.

I compared the foswiki page header with recommended header for iso8859-2 and found the diffrences causing errors

I attached two files with good and bad charset definitions in header and meta

Regards, Arek

-- BioSmoothly - 13 Feb 2010

The server won't serve attached HTML documents to avoid some spam, but the files contain:

Good HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"><head>
<title> good charset</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2" />
<body>
witaj &#347;wiecie (Hello world)
</body>
</html>

Bad HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl_PL" lang="pl_PL"><head>
<title> good charset</title>

<meta http-equiv="Content-Type" content="text/html; charset=pl_PL.ISO-8859-2" />
<body>
witaj ¶wiecie (Hello world)
</body>
</html>

-- GeorgeClark - 16 Mar 2011

According to RFC3066, I'm hoping simply changing the underscore to a dash (pl_PL to pl-PL) will fix the lang attribute (the first 'pl' before the dash is the "primary language subtag", the rest is optional for the client). Or at least, that's my reading of it.

-- PaulHarvey - 16 Mar 2011

I've had to chicken-out of this. The change is trivial but I lack the time to test properly.

-- PaulHarvey - 01 May 2011

Deferring to 1.1.5. This needs someone with I18N experience to test.

-- GeorgeClark - 13 Dec 2011

Deferring again, to 1.2.

-- GeorgeClark - 05 Apr 2012

Deferring to 1.2.1. Needs an I18N developer.


The LANG attribute was fixed in Item12482. The charset is fine since 1.2.0 beta 2 (unicode)

-- Main.CrawfordCurrie - 25 Jun 2015 - 05:59
 

ItemTemplate edit

Summary localization; bad charset definitions for non english pages (in header and meta)
ReportedBy BioSmoothly
Codebase 1.0.9
SVN Range
AppliesTo Engine
Component FoswikiRender, I18N
Priority Normal
CurrentState Closed
WaitingFor
Checkins
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
I Attachment Action Size Date Who Comment
bad_charset.htmlhtml bad_charset.html manage 363 bytes 13 Feb 2010 - 12:50 BioSmoothly page with bad charset
good_charset.htmlhtml good_charset.html manage 351 bytes 13 Feb 2010 - 12:50 BioSmoothly page with appropriate charset
Topic revision: r10 - 05 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy