• 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: Unicode - Converting memory to match NSCell -stringvalue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode - Converting memory to match NSCell -stringvalue?


  • Subject: Re: Unicode - Converting memory to match NSCell -stringvalue?
  • From: ruffnex <email@hidden>
  • Date: Sat, 31 May 2003 16:13:31 +0800

Chris & Finlay,

Yes, I think how the compiler treats string constants in strange encodings is the key. There was en error in my original post, and the strings did not display identically in the textfield.

In any case, empirical evidence suggests that for UTF8 constant strings, the underlying bytes are not copied exactly into object code.

As a practical solution, for anybody in the same situation, put foreign language constant strings into "Localizable.strings" and use NSLocalizedString to access them. This works fine.

Perhaps there is something in the docs, but I haven't seen it (yet).

Thanks,
Simon

On Friday, May 30, 2003, at 08:15 PM, Chris Ridd wrote:

On 30/5/03 12:10 pm, Finlay Dobbie <email@hidden> wrote:
On Friday, May 30, 2003, at 01:54 am, ruffnex wrote:

I have a file in ProjectBuilder, promoted to UTF-8, containing a
constant string: @"....4chars" (where . is a Chinese character).

I'm pretty sure that there are issues with string constants in strange
encodings. @"\u97f3\u9891\u63d2\u4ef64chars" might work, though.

The OP noted that both strings displayed identically in the textfield, so
presumably the strings are "OK" albeit different. I'm wondering if the
problem is really that one of the strings is decomposed Unicode and the
other one isn't. I did have a quick go at using NSString's
{pre,de}composedStringWith{Canonical,Compatibility}Mapping methods, but was
unable to turn the former string into the latter. That might be due to my
ineptitude of course!

Cheers,

Chris
_______________________________________________
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.
_______________________________________________
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: Unicode - Converting memory to match NSCell -stringvalue?
      • From: Chris Hanson <email@hidden>
References: 
 >Re: Unicode - Converting memory to match NSCell -stringvalue? (From: Chris Ridd <email@hidden>)

  • Prev by Date: [ANN] iList 1.4b7
  • Next by Date: Re: Oracle support in 10.2 client?
  • Previous by thread: Re: Unicode - Converting memory to match NSCell -stringvalue?
  • Next by thread: Re: Unicode - Converting memory to match NSCell -stringvalue?
  • Index(es):
    • Date
    • Thread