AndieB Posted September 12, 2007 Share Posted September 12, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/69081-convert-string-charset/ Share on other sites More sharing options...
effigy Posted September 12, 2007 Share Posted September 12, 2007 I'm not well read on the subject, but from the manual I gather that each connection can specify it's own character set via SET CHARACTER SET. Quote Link to comment https://forums.phpfreaks.com/topic/69081-convert-string-charset/#findComment-347297 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.