Link to home
Start Free TrialLog in
Avatar of gplana
gplanaFlag for Spain

asked on

stringWithUTF8String returns empty string for a non-empty one

Hi.

I'm developing an iPhone application which gets some data from SQLite to a mutable array. Inside the loop that treats every record, I have something like this:

char *nameC = (char *)sqlite3_column_text(myStatement, 1);
name = [NSString stringWithUTF8String:(const char*)nameC];

Open in new window


Most of records are converted well, but the problem is for a few records I'm getting nameC correctly but I'm getting an empty string on name variable (not a null pointer, but an empty string). Some of the working strings have some non-english characters, and some of the failing strings have just english characters, so I don't think it's an encoding issue.

Just if it helps, I'm using Automatic Counting References (so I think it couldn't be a memory leak issue) and also

Any clue ?
ASKER CERTIFIED SOLUTION
Avatar of designatedinitializer
designatedinitializer
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gplana

ASKER

Now it seems to work. Thanks.