• 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: How to get the length of a string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the length of a string?


  • Subject: Re: How to get the length of a string?
  • From: Aki Inoue <email@hidden>
  • Date: Tue, 21 Aug 2001 11:28:19 -0700

It's not just future proof, but required.

The filesystem representation on Mac OS X is DECOMPOSED (or Form D) UTF-8.
-UTF8String just convert NSString/CFString to UTF8 where fileSystemRepresentation also decomposes on the fly.

Aki

On 2001.08.21, at 11:02, Jim Correia wrote:

At 1:20 PM -0300 8/21/01, Rainer Brockerhoff wrote:

If you're handling file paths, always use:
n = strlen([my_string UTF8String]);

This may be splitting hairs, but if you want a file system path encoded string, you should use fileSystemRepresentation. Yes, today on Mac OS X this is UTF8 encoded, but if you use this message your code should be future proof.

Jim
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Re: How to get the length of a string? (From: Jim Correia <email@hidden>)

  • Prev by Date: Menu Mud
  • Next by Date: implementing a Viewer for file type (NOT Editor!)
  • Previous by thread: Re: How to get the length of a string?
  • Next by thread: Re: How to get the length of a string?
  • Index(es):
    • Date
    • Thread