Re: Switching to UTF-8. Need help.
| From: | Jasper Bryant-Greene | Date: | Fri, 24 Mar 2006 09:56:58 +0000 |
| Subject: | Re: Switching to UTF-8. Need help. | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232531@lists.php.net to get a copy of this message | ||
If you're on *nix:
man iconv
otherwise, I have no idea, sorry.
Jasper
Andy wrote:
No it was not. If I save it with UFT8 encoding it works well. So, do I have to convert all the files to UTF8 encoding? Is there an easy way to do that? ----- Original Message ----- From: "Jasper Bryant-Greene" <jasper@album.co.nz> To: "Andy" <frum@ar-sd.net> Cc: <ceo@l-i-e.com>; <php-general@lists.php.net> Sent: Friday, March 24, 2006 11:18 AM Subject: Re: [PHP] Switching to UTF-8. Need help.Is the file saved in UTF-8 encoding (the PHP script itself)? Jasper Andy wrote:This is my code: <?php $str = "öüéööööéééÉooOOúúúú"; echo $str; echo "<br>"; echo utf8_encode ($str); ?> ???????????????????? öüéööööéééÉõõÕÕúúúú I tried all the ways: <meta http-equiv="content-type" content="text/html; charset=UTF-8"> and <?php header('Content-Type: text/html;charset=UTF-8');?> etc. The first echo... is not showed correctly. The second (with the encoding function) works well. In php.ini the default encoding is UFT-8. The webserver sends the correct encoding. By default the browser(tested on IE and firefox) sees as UFT-8 encoding for the page. If I output the string with utf8_encode function than it wroks well. But... it this the solution??? I don't want to modify the whole project. Best regards, Andy. ----- Original Message ----- From: "Richard Lynch" <ceo@l-i-e.com> To: "Andy" <frum@ar-sd.net> Cc: <php-general@lists.php.net> Sent: Friday, March 24, 2006 2:14 AM Subject: Re: [PHP] Switching to UTF-8. Need help.Check the HEADERS your web-server is sending. If they don't have Charset UTF-8 in there, it won't work on REAL browsers (Mozilla based) Then, for reasons known only to Microsoft, you have to use a META tag to define the Charset for IE. MS will *ignore* the headers in favor of a heuristic whereby they count the number of characters in any given document which do/don't fit into various common charsets, and then they choose the charset based on that. Apparently, MS assumes that web-designers who can only handle META tags are smarter than developers who use header() function. Go figure. :-^ On Thu, March 23, 2006 10:13 am, Andy wrote:Hi to all, We are developing a multilanguage application, and slowly it seems that the Latin1(ISO 5589 1) encoding is not enough. I tried simply to convert the database and the encoding of the php to UTF-8, but I'm getting some problems. If I make an echo 'möbel, Belgien' the browser does not show me the correct character. If I look in the source of the document the character is good. Default encoding of the browser is UTF-8. If I change manually the browser encoding then the chars are showed correclty. We have a lot of "defines" with fix texts, which are full with german and french characters. Any of these aren't shower correctly. What is the workaround for this? Best regards, Andy.-- Like Music? http://l-i-e.com/artists.htm