Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

using utf8_encode() on text that is already encoded

What happens if I use utf8_encode() on text that is already in a UTF-8 encoding?  If problems could be caused, how could they be avoided?
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

The man page says <QUOTE>Encodes an ISO-8859-1 string to UTF-8</QUOTE> so I expect that you would mung the data if you did this.  However the user-contributed notes contain a couple of examples on how to detect if a string is UTF-8.  You might use those in advance to know what strings to avoid.

http://us3.php.net/manual/en/function.utf8-encode.php

HTH, ~Ray
SOLUTION
Avatar of absx
absx
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial