Forum Moderators: phranque

Message Too Old, No Replies

What charset? French and Spanish is a mess

charset

         

john1000

12:21 am on Sep 19, 2006 (gmt 0)

10+ Year Member



hi,

im helping out someone with his website and thought i could do that in a sec.
wrong...
ive read a few pages and topics but what happens is this :

he wants to use 3 languages, english , french, and spanish.

its set to ISO-8859-1 but something goes wrong ...

when viewing in firefox and IE both are the same...

when i view french or spanish the text shows a lot of <?> in it..

i also tried utf 8 but nothing helps...

and weirdest thing is,if i change the language to french my browser changes to unicode utf 8 ,whitch then results in the messed up text.

and if i change it back to ISO-8859-1 then the french shows perfectly.
anyone can tell whats wrong?

encyclo

1:11 am on Sep 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As English, French and Spanish are all western European languages, you can either use ISO-8859-1 or UTF-8 for the encoding. In either case, you can use accented letters such as יטאמש directly in the text without resorting entity references - but the "correct" encoding for the pages in question depends on how the pages were saved originally. Non-ASCII characters are encoded differently in ISO-8859-1 and UTF-8, so if you define the wrong one for the page content, you will see display errors for those characters.

In Firefox, ensure that the Auto-Detect option is set to "Off" (as it should be by default). How is the charset defined for the page? Is there a meta charset element in the head? As I understand it, if you select ISO-8859-1 in the browser then the text displays correctly? That would indicate that ISO-8859-1 is the correct encoding.

One problem you may be encountering is if the server is sending a default charset in a HTTP header. For example, the server could be setting a default of UTF-8 (meaning that the non-ASCII characters would display incorrectly on an ISO-8859-1-encoded page), and due to the way that HTML over HTTP is handled, you cannot override this with a meta charset within the document. You can check this by loading the page in Firefox and pressing Ctrl+I and see what is listed as the Encoding. To solve this problem, you need to remove the default charset via the server configuration (httpd.conf in Apache) or via an .htaccess file:

AddDefaultCharset Off

[httpd.apache.org...]

john1000

6:19 pm on Sep 19, 2006 (gmt 0)

10+ Year Member



well its a phpnuke cms and the header part is pure basic contents like you see on any site,or standard nuke site.

but another weird thing..
if i add AddDefaultCharset Off to the htaccess the site goes into internal server error.

any reason for that?

john1000

9:19 pm on Sep 19, 2006 (gmt 0)

10+ Year Member



Anyone please?

encyclo

1:52 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the header part is pure basic contents like you see on any site

I'm not talking about the HTML output of the CMS, but the HTTP response headers sent by the server as available in the Page Info (Ctrl+I) in Firefox - if the charset is defined here as UTF-8 and the content is actually ISO-8859-1, then you will experience problems as you have described.

If you are the server administrator, check the httpd.conf for any default charset, or if it is a shared server, check with the hosting company.

john1000

3:31 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



ok thanks encyclo,i have no access to that,neither does he but ill pass it on to him and see what the host makes of it..
thank you.