String Encoding

  • I have international users who may have things like umlaut in file names / paths which I may get as CStrings given our Model.

    What NS string encoding should be used to preserve the umlaut and not crash? Is NSUTF8 OK?

    -koko
  • On 12 Jun 2012, at 12:42 PM, koko wrote:
    > I have international users who may have things like umlaut in file names / paths which I may get as CStrings given our Model.
    >
    > What NS string encoding should be used to preserve the umlaut and not crash? Is NSUTF8 OK?

    UTF-8 can represent any Unicode character; if you need to store arbitrary NSStrings somewhere that only handles C-strings or bytestrings, then UTF-8 is a good choice.

    If you're *getting* these file names as C strings and need to convert them to NSStrings, then you need to know what encoding they are in when you get them --- we can't help you there.
  • When dealing with the file system pathnames, you should use the file system representation methods from NSString/NSFileManager.

    Specifically, -[NSFileManager fileSystemRepresentationWithPath:] and -[NSFileManager stringWithFileSystemRepresentation:].

    Aki

    On 2012/06/12, at 12:42, koko <koko...> wrote:

    > I have international users who may have things like umlaut in file names / paths which I may get as CStrings given our Model.
    >
    > What NS string encoding should be used to preserve the umlaut and not crash? Is NSUTF8 OK?
    >
    > -koko
  • Do you have examples in mind where the result of - [NSFileManager
    fileSystemRepresentationWithPath] differs from the one of - [NSString
    UTF8String]?

    On Tue, Jun 12, 2012 at 1:40 PM, Aki Inoue <aki...> wrote:
    > When dealing with the file system pathnames, you should use the file system representation methods from NSString/NSFileManager.
    >
    > Specifically, -[NSFileManager fileSystemRepresentationWithPath:] and -[NSFileManager stringWithFileSystemRepresentation:].
    >
    > Aki
    >
    > On 2012/06/12, at 12:42, koko <koko...> wrote:
    >
    >> I have international users who may have things like umlaut in file names / paths which I may get as CStrings given our Model.
    >>
    >> What NS string encoding should be used to preserve the umlaut and not crash? Is NSUTF8 OK?
    >>
    >> -koko

  • OK.  NSUTF8 it is.  I just sent a beta to Norway so I'll know more in the next 24 hours.

    -koko

    On Jun 12, 2012, at 3:13 PM, Stephane Sudre wrote:

    > Do you have examples in mind where the result of - [NSFileManager
    > fileSystemRepresentationWithPath] differs from the one of - [NSString
    > UTF8String]?
    >
    > On Tue, Jun 12, 2012 at 1:40 PM, Aki Inoue <aki...> wrote:
    >> When dealing with the file system pathnames, you should use the file system representation methods from NSString/NSFileManager.
    >>
    >> Specifically, -[NSFileManager fileSystemRepresentationWithPath:] and -[NSFileManager stringWithFileSystemRepresentation:].
    >>
    >> Aki
    >>
    >> On 2012/06/12, at 12:42, koko <koko...> wrote:
    >>
    >>> I have international users who may have things like umlaut in file names / paths which I may get as CStrings given our Model.
    >>>
    >>> What NS string encoding should be used to preserve the umlaut and not crash? Is NSUTF8 OK?
    >>>
    >>> -koko


    >
  • All the accented chars, for example, are represented differently.

    Aki Inoue

    On 2012/06/12, at 14:43, koko <koko...> wrote:

    > OK.  NSUTF8 it is.  I just sent a beta to Norway so I'll know more in the next 24 hours.
    >
    > -koko
    >
    >
    > On Jun 12, 2012, at 3:13 PM, Stephane Sudre wrote:
    >
    >> Do you have examples in mind where the result of - [NSFileManager
    >> fileSystemRepresentationWithPath] differs from the one of - [NSString
    >> UTF8String]?
    >>
    >> On Tue, Jun 12, 2012 at 1:40 PM, Aki Inoue <aki...> wrote:
    >>> When dealing with the file system pathnames, you should use the file system representation methods from NSString/NSFileManager.
    >>>
    >>> Specifically, -[NSFileManager fileSystemRepresentationWithPath:] and -[NSFileManager stringWithFileSystemRepresentation:].
    >>>
    >>> Aki
    >>>
    >>> On 2012/06/12, at 12:42, koko <koko...> wrote:
    >>>
    >>>> I have international users who may have things like umlaut in file names / paths which I may get as CStrings given our Model.
    >>>>
    >>>> What NS string encoding should be used to preserve the umlaut and not crash? Is NSUTF8 OK?
    >>>>
    >>>> -koko


    >>

previous month june 2012 next month
MTWTFSS
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  
Go to today