Page 1 of 1

Character encoding onPrivateMessage

Posted: 16 Aug 2010, 08:21
by ingaham
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