Re: converting / reading input arguments as utf8
Re: converting / reading input arguments as utf8
- Subject: Re: converting / reading input arguments as utf8
- From: Fritz Anderson <email@hidden>
- Date: Thu, 2 Feb 2006 09:54:38 -0600
On 2 Feb 2006, at 4:25 AM, koen gogne wrote:
this workes fine as long as the input given does simple ascii
characters
once i try using utf8 characters my input gets transferred
incorrectly,
and the input file is not found and hence not read correctly,
so no thumbs could be made.
an example:
this works perfectly:
/Users/demo/myprogram /Volumes/vol1/input/file.pdf /Volumes/vol1/
output/out
this gets scrambled incorrectly:
/Users/demo/myprogram /Volumes/vol1/ïnpût/filé.pdf /Volumes/vol1/
output/out
my code:
int main (int argc, const char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog([[NSString alloc] initWithFormat:@"Processing file '%s' to '%
s'.",argv[1], argv[2]]);
NSString *inpath;
NSString *outpath;
inpath = [[[NSString alloc] initWithFormat:@"%s",argv[1]]
stringByExpandingTildeInPath];
...
1) You'd have a better chance of getting this sort of question
answered on the cocoa-dev mailing list. This list is for discussion
of the Xcode tool environment.
2) Look at the class NSProcessInfo, and particularly its "arguments"
method. See if that works any better.
3) Use [NSString stringWithFormat:] where you have [[NSString alloc]
initWithFormat:]. Otherwise, you're leaking the NSStrings you get
from alloc.
-- F
--
Fritz Anderson -- http://www.manoverboard.org/
Consulting Programmer -- http://resume.manoverboard.org/
Step into Xcode, Now Available -- http://six.manoverboard.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden