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];
db = [db initToHost:@"127.0.0.1" withLogin:@"root" usingPort:3306];
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!
|All times are GMT -4. The time now is 11:22 AM.|
Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.