• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cant't use UTF-8 source files. False string interpretation.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cant't use UTF-8 source files. False string interpretation.


  • Subject: Re: Cant't use UTF-8 source files. False string interpretation.
  • From: Bernd Carl <email@hidden>
  • Date: Mon, 16 Feb 2004 21:40:38 +0100

Thank you for the explanation :-) Now it works.
Another problem it can't really solve: Manipulation of strings.
I need to split all arabic strings up into all its letters. So my problem
wasn't really a GUI thing, than rather a Cocoa thing.
Probably I have to work it out in unicode entities but this is really
annoying.

Clark Cox wrote:

On Feb 16, 2004, at 08:42, Bernd Carl wrote:

Hello,
my problem is that I cannot programmaticaly apply international
characters to my nib file.
It is possible to enter arabic letters in an NSTextField by using
IB's Attributes window but I can't [text1
setStringValue:@"someArabic"];
Whenever I try to do so XCode tells me that I need to change the
document layout to UTF-8. Then it does work in XCodes editor but
not in my GUI.
My window produces the usual crap when it's trying to display
UTF-8 in an non UTF-8 environment.

You can use UTF-8 strings in UTF-8 source files only with the C
string syntax (i.e. "my UTF-8 string"), not with the Objective-C
string syntax (i.e. @"my NSString"), as the latter only supports
7-bit, ASCII. You have two options here:

1) Use NSLocalizedString, and put your GUI strings in a .strings file
2) Use [NSString stringWithUTF8String: "My UTF-8 String"]

Option 1 is arguably better as it makes no assumptions about the
encoding of the source code, and it allows you to add other
localizations at a later date.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Cant't use UTF-8 source files. False string interpretation.
      • From: Dustin Voss <email@hidden>
References: 
 >Cant't use UTF-8 source files. False string interpretation. (From: Bernd Carl <email@hidden>)
 >Re: Cant't use UTF-8 source files. False string interpretation. (From: Clark Cox <email@hidden>)

  • Prev by Date: Re: How do I soft-wrap text at a specific line length?
  • Next by Date: Re: Slow Cocoa
  • Previous by thread: Re: Cant't use UTF-8 source files. False string interpretation.
  • Next by thread: Re: Cant't use UTF-8 source files. False string interpretation.
  • Index(es):
    • Date
    • Thread