Re: Switching to UTF-8. Need help.

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

 



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@xxxxxxxxxxx>
To: "Andy" <frum@xxxxxxxxx>
Cc: <ceo@xxxxxxxxx>; <php-general@xxxxxxxxxxxxx>
Sent: Friday, March 24, 2006 11:18 AM
Subject: Re:  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@xxxxxxxxx>
To: "Andy" <frum@xxxxxxxxx>
Cc: <php-general@xxxxxxxxxxxxx>
Sent: Friday, March 24, 2006 2:14 AM
Subject: Re:  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









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