Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mac > Cocoa
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Cocoa section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 18th, 2010, 04:03 AM
Registered User
 
Join Date: May 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default UTF8 problem in getting data from mySQL

I'm programming in Objective-C and use mySQL as database.
I added MCPKit Framework (to facilitate mySQL connection).
After successfully connected to mySQL, I had problem with data display on table view. My Vietnamese text don't display properly! For example: "Nguyễn Thị Hằng" appears as "Nguy?n Thị H?ng".
In AppleScript, I would easily include: --default-character-set-UTF8. What would be alternative way in Objective-C?

For reference, my code is as follow:

MCPConnection *db=[MCPConnection alloc];
MCPResult *result;
NSArray *theColNames;
db = [db initToHost:@"127.0.0.1" withLogin:@"root" usingPort:3306];
[db setPassword:@""];
NSLog(@"Connect: %d", [db connect]);
NSLog(@"SelectDB: %d", [db selectDB:@"MySystem"]);
if ([db isConnected])
{
result = [db queryString:@"select BookName, Type, Author from tbl_Book"];
...
}

Many thanks for your soon reply!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem writing listview data to mysql db method Pro VB 6 2 April 10th, 2007 07:17 PM
PHP-MySQL Insert Data problem forexen PHP Databases 1 March 13th, 2007 12:58 AM
asp utf8 for mysql, utf16 for winXP :( Janet Classic ASP Professional 0 September 18th, 2006 02:40 AM
problem writing listview data to mysql db method Pro VB Databases 0 May 17th, 2006 06:18 AM
problem with uploading blob data to MySQL DB kyle_shea PHP Databases 1 March 8th, 2005 05:15 PM



All times are GMT -4. The time now is 10:00 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.