See ChangeLog

Monotone-Parent: 4437a82e041d016710ea3a45d8b7cf5b6341afff
Monotone-Revision: 0746b51101ad96419ffd4e8f557f967f13b70a60

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2009-10-13T20:17:29
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2009-10-13 20:17:29 +00:00
parent bf95e10746
commit a285132f8b
8 changed files with 81 additions and 41 deletions
@@ -97,9 +97,10 @@ const int jsonDoNotIndent = -1;
jsonString = jsonNullString;
else if ([value respondsToSelector:@selector(objCType)]) { // NSNumber - representing true, false, and any form of numeric
NSNumber *number = (NSNumber *)value;
if (((*[number objCType]) == 'c') && ([number boolValue] == YES)) // true
const char *t = [number objCType];
if (((*t == 'c') || *t == 'C') && ([number boolValue] == YES)) // true
jsonString = jsonTrueString;
else if (((*[number objCType]) == 'c') && ([number boolValue] == NO)) // false
else if (((*t == 'c') || *t == 'C') && ([number boolValue] == NO)) // false
jsonString = jsonFalseString;
else // attempt to handle as a decimal number - int, fractional, exponential
// TODO: values converted from exponential json to dict and back to json do not format as exponential again