Q:

Hungary character encoding

I'm trying to convert hungarian characters to NSData. 
Using the code page of PC865. 
Here's here code. 
NSString *test = @"őű";
NSStringEncoding *coding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingDOSNordic);
        NSData *myData = [test dataUsingEncoding:coding allowLossyConversion:YES];
        NSLog(@"my data %@", myData);

The output that I receive is my data <3f3f> 
They both are different character, but why do I receive the same data and actually they both are wrong data after looking at the PC865 table.

A:

There is an error in your code, NSStringEncoding is scalar type, not a pointer to an Objective-C object. Therefore it must be
NSStringEncoding coding = ...

without the *.
But the main problem is that the Code Page 865 (Nordic Languages, http://en.wikipedia.org/wiki/Code_page_865)
does not contain the characters

ő = U+0151 = LATIN SMALL LETTER O WITH DOUBLE ACUTE
ű = U+0171 = LATIN SMALL LETTER U WITH DOUBLE ACUTE

Since you specified allowLossyConversion:YES, the conversion does not fail, but
replaces the characters with a question mark (0x3F).
If you choose the Code Page 852 instead (Central European languages, http://en.wikipedia.org/wiki/Code_page_852):
NSStringEncoding coding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingDOSLatin2);

then you will get the result <8bfb>.

