Re: problem with greek language

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rosen wrote:
> I have one very big problem: I create website with english and greek
> language. I use "iso-8859-1" encoding for my website.
> I show the greek language text with encoded chars like
> "τηλεόρα&si;"

Representing such characters as HTML entities is fine.

> On the website I have no problems - everything shows ok, but when I pass
> this greek encoded string to javascript - i.e. "alert('τη');" the
> browser doesn't decode the greek symbols and the alert shows me the same
> :"τη"

The data between <script> and </script> is, in HTML documents, CDATA, so
HTML entities are not decoded. You either have to encode the document using
a character encoding which supports the characters you want (such as
UTF-8), configure your server to emit a suitable HTTP header, and use
literal versions of those characters or represent those characters as
\uXXXX (where XXXX is the Unicode character specified by four hexadecimal
digits), or \XXX (three octal digits representing the Latin-1 character),
or \xXX (two hexadecimal digits representing the Latin-1 character).

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux