Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Latin1 - UTF-8 Unicode special character issue

Status
Not open for further replies.

monkey64

Technical User
Apr 27, 2008
69
GB
Firstly, I'm not sure whether this post should be in the MySQL or PHP forum. I'm lost with one...

I have a problem with special characters, such as Ö, showing up on my web page.

I'm using a VB.NET program to get values from an Access Database and create a php upload script. I'm specifying that the php page should be written in UTF-8 Unicode and I believe it is. I'm also specifying the table character set and collation: ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

When viewed in Textpad, the characters all look correct, with the exception of the ™ symbol.

When I execute the upload script and check the values in the MySQL database, it reverts to Latin1 and trashes the special characters. Also the output when viewed on a web page is also trashed.

From the PhpMyadmin home page, the MySQl Charset and Connection Collation are both: UTF-8 Unicode (utf8).

Any ideas?

 
Directly after opening a connection to MySQL, send the following command:
Code:
SET NAMES utf8;
Otherwise, MySQL thinks that the client communicates in latin-1.


+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Thanks for that, but I found that it was actually my VB.NET program which was at fault. I would go into detail, but it would be wasted as this is not a VB forum!

Thanks
 
not wasted, just misplaced. i am sure that the vb.net forum would benefit from you outlining the problem and your fix and perhaps cross-referencing this thread.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top