Jump to content

Convert STRING charset


AndieB

Recommended Posts

Hi all Gurus!

 

I have a MySQL database, which stores data in UTF-8 Unicode format.

I have a webpage which has a form where I enter data to store the information and the CHARSET for that page is ISO-8859-1 (latin1).

 

When I fetch data from my database on a page that has the CHARSET ISO-8859-1 the output is great!

But when I now from another page has UTF-8 Unicode CHARSET set and fetch data from the database, some of the characters are messed up (like the Swedish Å Ä Ö characters).

 

My question follows:

Can I with PHP, fetch text from my database into a STRING and then "convert" from ISO-8859-1 to UTF-8 Unicode before outputting it to the page which has CHARSET UTF-8 Unicode?

 

OR

 

Do I have to "loop" through and replace "bad/wrong" characters into UTF-8 Unicode, and if so, HOW?

 

I am thankful for any kind of help!

 

Sincerely,

Andreas

Link to comment
https://forums.phpfreaks.com/topic/69081-convert-string-charset/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.