FROM : The DJ
DATE : Sun Jan 13 15:49:36 2002
I have a small problem.
I need to edit the hostconfig file.
I need to change SAMBASERVER=-NO- into SAMBASERVER=-YES-
So what I do is the following. I read the file into an NSData object
I convert this into a string. Get the range of SAMBASERVER=-NO- and replace
that range with the NSString SAMBASERVER=-YES- So far all is well.
Then I convert the string back into a Data object and write that back to the
file after backing up the old file.
In this file is this following line, which is of course pretty standard.
APPLETALK_HOSTNAME="Derk-Jan Hartman\xd5s Computer" \xd5s standing for '
Now if I use NSASCII encoding to convert the modified string into a DATA
object, then I loose the the entire file, because some characters cannot be
converted, I guess the ' character.
So what encoding does apple usually use here? I tried MacRoman and Latin1,
but both were incorrect. Should I use Unicode or something?
DJ
---------------------------------------------------------------------------
Universiteit Twente
---------------------------------------------------------------------------
Derk-Jan 'The DJ' Hartman
ICQnr: 10111559
Mail: mailto:<email_removed>
WWW: http://home.student.utwente.nl/d.hartman/
Goto: http://www.student.utwente.nl/~macsatcampus
DATE : Sun Jan 13 15:49:36 2002
I have a small problem.
I need to edit the hostconfig file.
I need to change SAMBASERVER=-NO- into SAMBASERVER=-YES-
So what I do is the following. I read the file into an NSData object
I convert this into a string. Get the range of SAMBASERVER=-NO- and replace
that range with the NSString SAMBASERVER=-YES- So far all is well.
Then I convert the string back into a Data object and write that back to the
file after backing up the old file.
In this file is this following line, which is of course pretty standard.
APPLETALK_HOSTNAME="Derk-Jan Hartman\xd5s Computer" \xd5s standing for '
Now if I use NSASCII encoding to convert the modified string into a DATA
object, then I loose the the entire file, because some characters cannot be
converted, I guess the ' character.
So what encoding does apple usually use here? I tried MacRoman and Latin1,
but both were incorrect. Should I use Unicode or something?
DJ
---------------------------------------------------------------------------
Universiteit Twente
---------------------------------------------------------------------------
Derk-Jan 'The DJ' Hartman
ICQnr: 10111559
Mail: mailto:<email_removed>
WWW: http://home.student.utwente.nl/d.hartman/
Goto: http://www.student.utwente.nl/~macsatcampus
| Related mails | Author | Date |
|---|---|---|
| The DJ | Jan 13, 15:49 | |
| Matt Judy | Jan 14, 11:44 | |
| The DJ | Jan 15, 12:13 |






Cocoa mail archive

