Reputation: 451
I am getting data nightly from a web service that stores their fields in latin, but my database is in utf8. Is it possible to convert the data string to utf8 when I update or insert the record?
Upvotes: 1
Views: 6413
Reputation: 3799
Have a look at the features provided by the Multibyte String Functions in PHP. Specifically, I think that the mb_convert_encoding
is the function you are looking for.
$output = mb_convert_encoding ($input, 'UTF-8', 'ISO-8859-1');
ISO-8859-1 is the official encoding standard for "Latin-1", as per Wikipedia.
Upvotes: 0
Reputation: 80629
$output = utf8_encode ( $inputstring );
Read more about utf8_encode
Upvotes: 2