7 aug 2014 kl. 22:28 skrev Peter Edberg <[email protected]>:

> This is intentional. The character is ‘−’ U+2212 MINUS SIGN with UTF-8 
> representation 0xE2 0x88 0x92. Many locales prefer the proper Unicode minus 
> sign for negative numbers, instead of using U+002D HYPHEN-MINUS.
> 
> Seems like the bug here is trying to save the file as WindowsLatin1.

The problem is that this worked before 10.9 and the issue is that a customer of 
my client needs a WindowsLatin1 file (I don’t know why, but that is the 
requirement), and I use NSNumberFormatter to format numbers fetched from a 
database placing them into a a text file, and this is done by a cmdline tool 
fired off from the main app.

7 aug 2014 kl. 23:02 skrev Jens Alfke <[email protected]>:

> - (NSData *)dataUsingEncoding:(NSStringEncoding)encoding 
> allowLossyConversion:(BOOL)lossy;

I will try that (how did I miss that call??)

Thanks,

/Totte


> - Peter E
> 
> On Aug 7, 2014, at 12:00 PM, [email protected] wrote:
>> Message: 5
>> Date: Thu, 07 Aug 2014 08:43:04 +0200
>> From: Totte Alm <[email protected]>
>> To: "[email protected] List" <[email protected]>
>> Subject: NSNumberFormatter negative and NSWindowsLatin1
>> Message-ID: <[email protected]>
>> Content-Type: text/plain;    charset=windows-1252
>> 
>> Hello,
>> 
>> 
>> In 10.9 I (or a client really) just stumbled upon a weirdness regarding 
>> NSNumberFornatter (Swedish default settings), where a negative number is 
>> transformed to a string and that string is later written to a file using 
>> NSString Write.. 
>> 
>> The - sign (minus) that NSNumberFormatter puts into the string is a special 
>> UTF-8 character /u8892 and it won’t convert when saving the file as 
>> WindowsLatin1, NSString write giving an error.
>> 
>> Workaround:
>> 
>> [doubleFormatter setMinusSign:@"-"];
>> 
>> Anyone knows if this is intentional or just a bug that needs to be filed on 
>> radar?
>> 
>> / Totte
> 

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to