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

Unicode - Converting memory to match NSCell -stringvalue?


  • Subject: Unicode - Converting memory to match NSCell -stringvalue?
  • From: ruffnex <email@hidden>
  • Date: Fri, 30 May 2003 08:54:22 +0800

Hi,

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

NSLog(@"%@",s) outputs:
\\310\\374\\u2265\\310\\242\\353\\312\\350\\355\\u2030\\252\\u22024chars

-dataUsingEncoding:NSUnicodeStringEncoding gives the following:
<feff00c8 00fc2265 00c800a2 00eb00ca 00e800ed 203000aa 22020034 00630068 00610072 0073>

However, if I enter the same string into a NSTextField (via cut and paste while running my code), and then process the NSTextField's -stringValue: I get:

\\u97f3\\u9891\\u63d2\\u4ef64chars
<feff97f3 989163d2 4ef60034 00630068 00610072 0073>

I want to achieve this second form. Does anybody know how? Or why in both cases, NSUnicodeStringEncoding gives different data results (even though both display correctly)? Is it to do with file promotion to UTF-8? I tried promotion to UTF-16 but get compile errors even after converting and re-interpreting the source file.

Thanks,
Simon
_______________________________________________
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: Finlay Dobbie <email@hidden>
  • Prev by Date: Status of Java Bridge?
  • Next by Date: Re: Dragging Methods for NSOutlineView
  • Previous by thread: Re: Status of Java Bridge?
  • Next by thread: Re: Unicode - Converting memory to match NSCell -stringvalue?
  • Index(es):
    • Date
    • Thread