Re: Encoding problem with C API
Posted by: Thomas Rix
Date: September 23, 2005 12:47AM

I know this thread is a little bit outdated, but i had similar problems and happened upon this thread via Google, so others might too...

A database client was to be compiled on Max OS X.4 wich has access to a text column with UTF-8 - encoding. Output is displayed in MacRoman, default charset was Latin1. Though the conversion was easy, i lost characters on the way from database to screen.

The solution was:
mysql_query(mysql,"SET NAMES 'utf8'"); /* note the apostrophes: 'utf8' */
mysql_query(mysql,"SET CHARACTER SET utf8"); /* no apostrohes */

Everything was set on UTF-8 and worked fine.

Options: ReplyQuote


Subject
Views
Written By
Posted
7419
April 10, 2005 08:52AM
6319
April 15, 2005 08:37AM
Re: Encoding problem with C API
6055
September 23, 2005 12:47AM
3694
November 27, 2005 12:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.