Search code examples
xcodemacoscocoanstextfieldnstextview

Wrong japanese characters


I have some problems in cocoa with some japanese characters. I try to print this character:

Wrong japanese character

But it prints this:

Right japanese character

This happens with more characters and I have no idea why.

I know that this doesn't happen with HiraginoKaku and HiraginoMaru fonts, but it happens with all the rest and should not.

Any idea?

Here the character (not image) to test: 写

Thanks in advance!

David


Solution

  • Well, I got a solution. The thing is that I had the following code in the AppDelegate:

    - (void)applicationWillFinishLaunching:(NSNotification *)notification
    {
        [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@"en", nil] forKey:@"AppleLanguages"];
    }
    

    Which forces the app to show everything in English, dialogs included, but it affects the Japanese characters.