Re: Omission of % character when loading a string from a file?
Re: Omission of % character when loading a string from a file?
- Subject: Re: Omission of % character when loading a string from a file?
- From: Andy Lee <email@hidden>
- Date: Thu, 26 Dec 2002 13:36:32 -0500
At 7:10 PM +0100 12/26/02, Jan Van Boghout wrote:
Nope, NSLog isn't fooling me. I'm parsing css files, and my % signs
are lost. I am trying this out with the css file I downloaded at:
http://www.w3c.org/Style/shadows.css In one property there is a font
size of 140%, but it comes through as 140. And the % isn't lost in
my parsing, it's not in the string that is loaded in the first place
either. I select a file using an open panel and take its path. Then
I do this:
css = [[NSMutableString alloc] initWithContentsOfFile:[op filename]];
No % signs are in the resulting string. This is the only line of
code that causes it, so I guess loading a string directly from a
file isn't what I should be doing. But what should I do then? I'd
think this is supposed to work.
I'd think so too. Oddly enough, it works for me. I downloaded .css
file from the URL gave and did this in a little scratch program:
NSString *path = @"/Volumes/FileDrop/downloads/___RECENT/shadows.css";
NSString *s = [[NSMutableString alloc] initWithContentsOfFile:path];
NSLog(@"%@", s);
The "font-size: 140% /*200%*/;" showed up just fine.
Can you post a little more of your code? And again, *how* are you
finding out that your string does not contain the %? What is your
proof?
--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.