Character encoding onPrivateMessage

Post here all your questions related with the SmartFoxServer iPhone API

Moderators: Lapo, Bax

ingaham
Posts: 2
Joined: 22 Jun 2010, 13:06

Character encoding onPrivateMessage

Postby ingaham » 16 Aug 2010, 08:21

Hello,

I just want to read a Hungarian client name to a NSString* object, but the character encoding was false. I receive a Private message from the server (it is sent by a flash client).

The original message is: 'Gellért laptopja'

At first I tried on this way:

Code: Select all

NSString* message = [NSString stringWithFormat:@"%@:", [evt.params objectForKey:@"message"] ];

The value of message is :'gell&#xe9rt laptopja'.

I tried to use the encoding function of NSString:

Code: Select all

NSString* message = nil;
char *nameData = (char*) [[evt.params objectForKey:@"message"] cStringUsingEncoding: NSASCIIStringEncoding];
   if (nameData) {
      message = [[NSString alloc] initWithUTF8String:nameData];
   }


But it does not work.

Have I set something on the application environment? I red, that the SmartFox server is universal in the word of the characters...

Please, somebody help me.

Thanks

Return to “iPhone Objective-C API”

Who is online

Users browsing this forum: No registered users and 13 guests