Professional Web Applications Themes

Getting utf8-string from FSRefMakePath - Mac Programming

Hi, i thought FSRefMakePath would give me the FileName as a UTF8-string, but it isn't. for example for a file named "" (the letter is the german for ae, or 'latin small letter a with diaeresis') FSRefMakePath returns 0x61, 0xcc, 0x88, 0x00. the correct UTF8-String would be 0xc3, 0xa4, 0x00. fopen semms to be working with both, but i need it in correct utf8. what kind of string-encoding is returned from FSRefMakePath and how do i convert it to UTF8?...

  1. #1

    Default Getting utf8-string from FSRefMakePath

    Hi,

    i thought FSRefMakePath would give me the FileName
    as a UTF8-string, but it isn't.

    for example for a file named "" (the letter
    is the german for ae, or 'latin small letter a with
    diaeresis') FSRefMakePath returns
    0x61, 0xcc, 0x88, 0x00.

    the correct UTF8-String would be 0xc3, 0xa4, 0x00.
    fopen semms to be working with both, but i need it
    in correct utf8.

    what kind of string-encoding is returned from
    FSRefMakePath and how do i convert it to UTF8?

    Stefan Guest

  2. #2

    Default Re: Getting utf8-string from FSRefMakePath

    In article <c0t8j4$1a1dgk$news.uni-berlin.de>,
    Stefan Heinsen <de> wrote:
     

    The file system uses fully decomposed characters UTF8, so (assuming I
    read correctly before coffee), 0x61 0xcc 0x88 0x00 is "latin small
    letter a" + "diaeresis".

    0xc3 0xa4 0x00 would be the fully composed version of that string, but
    in the end, they would work the same in the file system (there were some
    bugs with this in earlier versions of OS X, but I believe they were all
    ironed out by 10.2).
    Glenn Guest

  3. #3

    Default Re: Getting utf8-string from FSRefMakePath

    In article <c0t8j4$1a1dgk$news.uni-berlin.de>, Stefan
    Heinsen <de> wrote:
     

    It's UTF-8. From Files.h:

    /*
    * FSRefMakePath()
    *
    * Summary:
    * converts an FSRef to a POSIX path
    *
    * Parameters:
    *
    * ref:
    * the file/dir to get the POSIX path for
    *
    * path:
    * a pointer to a buffer which FSRefMakePath will fill with a UTF8
    * encoded C string representing the path the the specified FSRef
    *
    * maxPathSize:
    * the maximum size path length in bytes that path can hold
    *
    * Availability:
    * Non-Carbon CFM: not available
    * CarbonLib: in CarbonLib 1.1 and later
    * Mac OS X: in version 10.0 or later
    */
    Chris Guest

  4. #4

    Default Re: Getting utf8-string from FSRefMakePath

    Glenn Andreas schrieb:
     

    i was not aware of a decomposed utf-type. Seems we have to
    upgrade our intern stringclass to work with that encoding.

    thanks
    Stefan Guest

  5. #5

    Default Re: Getting utf8-string from FSRefMakePath

    Am Tue, 17 Feb 2004 09:14:04 -0600 schrieb Chris Baum:
     
    >
    > It's UTF-8. From Files.h:[/ref]

    thanks. the problem was that our stringclass couldn't
    handle strings in decomposed utf-8 format properly, only
    fully composed utf-8.

    stefan
    Stefan Guest

Similar Threads

  1. Replies: 5
    Last Post: November 10th, 09:13 PM
  2. ISO-Latin and UTF8
    By Tulan W. Hu in forum PERL Miscellaneous
    Replies: 0
    Last Post: August 1st, 01:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139