<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>BSJSONEncoder.h</filename>
    </added>
    <added>
      <filename>BSJSONEncoder.m</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -34,6 +34,8 @@
 		289A91820994005D0026B656 /* json_test_valid_06.txt in Resources */ = {isa = PBXBuildFile; fileRef = 289A91810994005D0026B656 /* json_test_valid_06.txt */; };
 		289A91830994005D0026B656 /* json_test_valid_06.txt in Resources */ = {isa = PBXBuildFile; fileRef = 289A91810994005D0026B656 /* json_test_valid_06.txt */; };
 		28A021670DC0F11000324B9B /* json_test_invalid_01.txt in Resources */ = {isa = PBXBuildFile; fileRef = 28A021660DC0F11000324B9B /* json_test_invalid_01.txt */; };
+		581BAB610FCC62C100FC9A5F /* BSJSONEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 581BAB600FCC62C100FC9A5F /* BSJSONEncoder.m */; };
+		581BAB6F0FCC693200FC9A5F /* BSJSONEncoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 581BAB600FCC62C100FC9A5F /* BSJSONEncoder.m */; };
 		8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
 		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
 		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -83,6 +85,8 @@
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = &quot;&lt;absolute&gt;&quot;; };
 		29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = &quot;&lt;absolute&gt;&quot;; };
 		32CA4F630368D1EE00C91783 /* BSJSONAdditions_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSJSONAdditions_Prefix.pch; sourceTree = &quot;&lt;group&gt;&quot;; };
+		581BAB5F0FCC62C100FC9A5F /* BSJSONEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BSJSONEncoder.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+		581BAB600FCC62C100FC9A5F /* BSJSONEncoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BSJSONEncoder.m; sourceTree = &quot;&lt;group&gt;&quot;; };
 		8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = &quot;&lt;group&gt;&quot;; };
 		8D1107320486CEB800E47090 /* BSJSONAdditions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BSJSONAdditions.app; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
@@ -119,6 +123,8 @@
 				28278CF80991DC9F00BCE5A7 /* NSScanner+BSJSONAdditions.m */,
 				2889EE9A0F7997E500B514B9 /* NSString+BSJSONAdditions.h */,
 				2889EE9B0F7997E500B514B9 /* NSString+BSJSONAdditions.m */,
+				581BAB5F0FCC62C100FC9A5F /* BSJSONEncoder.h */,
+				581BAB600FCC62C100FC9A5F /* BSJSONEncoder.m */,
 			);
 			name = Classes;
 			sourceTree = &quot;&lt;group&gt;&quot;;
@@ -339,6 +345,7 @@
 				2889EE950F7956BB00B514B9 /* NSArray+BSJSONAdditions.m in Sources */,
 				2889EE9D0F7997E500B514B9 /* NSString+BSJSONAdditions.m in Sources */,
 				2889EEB20F799BA600B514B9 /* NSArray_UnitTests.m in Sources */,
+				581BAB610FCC62C100FC9A5F /* BSJSONEncoder.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -352,6 +359,7 @@
 				289A90470992AC4A0026B656 /* JSONValidTests.m in Sources */,
 				2889EE960F7956BB00B514B9 /* NSArray+BSJSONAdditions.m in Sources */,
 				2889EE9C0F7997E500B514B9 /* NSString+BSJSONAdditions.m in Sources */,
+				581BAB6F0FCC693200FC9A5F /* BSJSONEncoder.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};</diff>
      <filename>BSJSONAdditions.xcodeproj/project.pbxproj</filename>
    </modified>
    <modified>
      <diff>@@ -22,11 +22,7 @@
 
 #import &quot;NSArray+BSJSONAdditions.h&quot;
 #import &quot;NSScanner+BSJSONAdditions.h&quot;
-#import &quot;NSString+BSJSONAdditions.h&quot;
-
-@interface NSArray (PrivateBSJSONAdditions)
-- (NSString *)jsonStringForValue:(id)value withIndentLevel:(NSInteger)level;
-@end
+#import &quot;BSJSONEncoder.h&quot;
 
 @implementation NSArray (BSJSONAdditions)
 
@@ -51,12 +47,14 @@
 	[jsonString appendString:jsonArrayStartString];
 	
 	if ([self count] &gt; 0) {
-		[jsonString appendString:[self jsonStringForValue:[self objectAtIndex:0] withIndentLevel:level]];
+		[jsonString appendString:[BSJSONEncoder jsonStringForValue:[self objectAtIndex:0] withIndentLevel:level]];
 	}
 	
 	NSInteger i;
+  NSString *encoded;
 	for (i = 1; i &lt; [self count]; i++) {
-		[jsonString appendFormat:@&quot;%@ %@&quot;, jsonValueSeparatorString, [self jsonStringForValue:[self objectAtIndex:i] withIndentLevel:level]];
+    encoded = [BSJSONEncoder jsonStringForValue:[self objectAtIndex:i] withIndentLevel:level];
+		[jsonString appendFormat:@&quot;%@ %@&quot;, jsonValueSeparatorString, encoded];
 	}
 	
 	[jsonString appendString:jsonArrayEndString];
@@ -64,35 +62,3 @@
 }
 
 @end
-
-@implementation NSArray (PrivateBSJSONAdditions)
-
-- (NSString *)jsonStringForValue:(id)value withIndentLevel:(NSInteger)level
-{	
-	NSString *jsonString;
-	if ([value respondsToSelector:@selector(characterAtIndex:)]) // String
-		jsonString = [(NSString *)value jsonStringValue];
-	else if ([value respondsToSelector:@selector(keyEnumerator)]) // Dictionary
-		jsonString = [(NSDictionary *)value jsonStringValueWithIndentLevel:(level + 1)];
-	else if ([value respondsToSelector:@selector(objectAtIndex:)]) // Array
-		jsonString = [(NSArray *)value jsonStringValueWithIndentLevel:level];
-	else if (value == [NSNull null]) // null
-		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') &amp;&amp; ([number boolValue] == YES)) // true
-			jsonString = jsonTrueString;
-		else if (((*[number objCType]) == 'c') &amp;&amp; ([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
-			jsonString = [[NSDecimalNumber decimalNumberWithDecimal:[number decimalValue]] stringValue];
-	} else {
-		// TODO: error condition - it's not any of the types that I know about.
-		return nil;
-	}
-	
-	return jsonString;
-}
-
-@end</diff>
      <filename>NSArray+BSJSONAdditions.m</filename>
    </modified>
    <modified>
      <diff>@@ -23,9 +23,6 @@
 
 #import &lt;Foundation/Foundation.h&gt;
 
-extern NSString *jsonIndentString;
-extern const NSInteger jsonDoNotIndent;
-
 @interface NSDictionary (BSJSONAdditions)
 + (NSDictionary *)dictionaryWithJSONString:(NSString *)jsonString;
 </diff>
      <filename>NSDictionary+BSJSONAdditions.h</filename>
    </modified>
    <modified>
      <diff>@@ -21,17 +21,10 @@
 //  appreciated, just to let me know that people are finding my 
 //  code useful. You can reach me at blakeseely@mac.com
 
-#import &quot;NSArray+BSJSONAdditions.h&quot;
 #import &quot;NSDictionary+BSJSONAdditions.h&quot;
 #import &quot;NSScanner+BSJSONAdditions.h&quot;
 #import &quot;NSString+BSJSONAdditions.h&quot;
-
-NSString *jsonIndentString = @&quot;\t&quot;; // Modify this string to change how the output formats.
-const NSInteger jsonDoNotIndent = -1;
-
-@interface NSDictionary (PrivateBSJSONAdditions)
-- (NSString *)jsonStringForValue:(id)value withIndentLevel:(NSInteger)level;
-@end
+#import &quot;BSJSONEncoder.h&quot;
 
 @implementation NSDictionary (BSJSONAdditions)
 
@@ -56,7 +49,7 @@ const NSInteger jsonDoNotIndent = -1;
   BOOL first = YES;
 	NSString *valueString;
   for (NSString *keyString in self) {
-    valueString = [self jsonStringForValue:[self objectForKey:keyString] withIndentLevel:level];
+    valueString = [BSJSONEncoder jsonStringForValue:[self objectForKey:keyString] withIndentLevel:level];
     if (!first) {
       [jsonString appendString:jsonValueSeparatorString];
     }
@@ -72,35 +65,3 @@ const NSInteger jsonDoNotIndent = -1;
 }
 
 @end
-
-@implementation NSDictionary (PrivateBSJSONAdditions)
-
-- (NSString *)jsonStringForValue:(id)value withIndentLevel:(NSInteger)level
-{	
-	NSString *jsonString;
-	if ([value respondsToSelector:@selector(characterAtIndex:)]) // String
-		jsonString = [(NSString *)value jsonStringValue];
-	else if ([value respondsToSelector:@selector(keyEnumerator)]) // Dictionary
-		jsonString = [(NSDictionary *)value jsonStringValueWithIndentLevel:(level + 1)];
-	else if ([value respondsToSelector:@selector(objectAtIndex:)]) // Array
-		jsonString = [(NSArray *)value jsonStringValueWithIndentLevel:level];
-	else if (value == [NSNull null]) // null
-		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') &amp;&amp; ([number boolValue] == YES)) // true
-			jsonString = jsonTrueString;
-		else if (((*[number objCType]) == 'c') &amp;&amp; ([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
-			jsonString = [[NSDecimalNumber decimalNumberWithDecimal:[number decimalValue]] stringValue];
-	} else {
-		// TODO: error condition - it's not any of the types that I know about.
-		return nil;
-	}
-	
-	return jsonString;
-}
-
-@end</diff>
      <filename>NSDictionary+BSJSONAdditions.m</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,8 @@ extern NSString *jsonStringEscapedSlashString;
 extern NSString *jsonTrueString;
 extern NSString *jsonFalseString;
 extern NSString *jsonNullString;
+extern NSString *jsonIndentString;
+extern const NSInteger jsonDoNotIndent;
 
 
 @interface NSScanner (PrivateBSJSONAdditions)
@@ -56,4 +58,6 @@ extern NSString *jsonNullString;
 - (BOOL)scanJSONArrayEndString;
 - (BOOL)scanJSONStringDelimiterString;
 
+- (BOOL)scanUnicodeCharacterIntoString:(NSMutableString *)string;
+
 @end</diff>
      <filename>NSScanner+BSJSONAdditions.h</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,9 @@ NSString *jsonTrueString = @&quot;true&quot;;
 NSString *jsonFalseString = @&quot;false&quot;;
 NSString *jsonNullString = @&quot;null&quot;;
 
+NSString *jsonIndentString = @&quot;\t&quot;; // Modify this string to change how the output formats.
+const NSInteger jsonDoNotIndent = -1;
+
 @implementation NSScanner (PrivateBSJSONAdditions)
 
 - (BOOL)scanJSONObject:(NSDictionary **)dictionary
@@ -104,77 +107,51 @@ NSString *jsonNullString = @&quot;null&quot;;
 	BOOL result = NO;
 	if ([self scanJSONStringDelimiterString]) {
 		NSMutableString *chars = [[[NSMutableString alloc] init] autorelease];
-		NSString *characterFormat = @&quot;%C&quot;;
 		
 		// process character by character until we finish the string or reach another double-quote
 		while ((![self isAtEnd]) &amp;&amp; ([[self string] characterAtIndex:[self scanLocation]] != '\&quot;')) {
 			unichar currentChar = [[self string] characterAtIndex:[self scanLocation]];
 			unichar nextChar;
 			if (currentChar != '\\') {
-				[chars appendFormat:characterFormat, currentChar];
+				[chars appendFormat:@&quot;%C&quot;, currentChar];
 				[self setScanLocation:([self scanLocation] + 1)];
 			} else {
 				nextChar = [[self string] characterAtIndex:([self scanLocation] + 1)];
 				switch (nextChar) {
 				case '\&quot;':
 					[chars appendString:@&quot;\&quot;&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case '\\':
-					[chars appendString:@&quot;\\&quot;]; // debugger shows result as having two slashes, but final output is correct. Possible debugger error?
-					[self setScanLocation:([self scanLocation] + 2)];
+					[chars appendString:@&quot;\\&quot;];
 					break;
 				case '/':
 					[chars appendString:@&quot;/&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case 'b':
 					[chars appendString:@&quot;\b&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case 'f':
 					[chars appendString:@&quot;\f&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case 'n':
 					[chars appendString:@&quot;\n&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case 'r':
 					[chars appendString:@&quot;\r&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case 't':
 					[chars appendString:@&quot;\t&quot;];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				case 'u': // unicode sequence - get string of hex chars, convert to int, convert to unichar, append
 					[self setScanLocation:([self scanLocation] + 2)]; // advance past '\u'
-					NSString *digits = [[self string] substringWithRange:NSMakeRange([self scanLocation], 4)];
-					/* START Updated code modified from code fix submitted by Bill Garrison - March 28, 2006 - http://www.standardorbit.net */
-                    NSScanner *hexScanner = [NSScanner scannerWithString:digits];
-                    NSString *verifiedHexDigits;
-                    NSCharacterSet *hexDigitSet = [NSCharacterSet characterSetWithCharactersInString:@&quot;0123456789ABCDEFabcdef&quot;];
-					if (NO == [hexScanner scanCharactersFromSet:hexDigitSet intoString:&amp;verifiedHexDigits])
-                        return NO;
-                    if (4 != [verifiedHexDigits length])
-                        return NO;
-                        
-                    // Read in the hex value
-                    [hexScanner setScanLocation:0];
-                    unsigned unicodeHexValue;
-                    if (NO == [hexScanner scanHexInt:&amp;unicodeHexValue]) {
-                        return NO;
-                    }
-                    [chars appendFormat:characterFormat, unicodeHexValue];
-                    /* END update - March 28, 2006 */
-					[self setScanLocation:([self scanLocation] + 4)];
+          if (![self scanUnicodeCharacterIntoString: chars]) return NO;
+					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				default:
 					[chars appendFormat:@&quot;\\%C&quot;, nextChar];
-					[self setScanLocation:([self scanLocation] + 2)];
 					break;
 				}
+				[self setScanLocation:([self scanLocation] + 2)];
 			}
 		}
 		
@@ -210,53 +187,79 @@ NSString *jsonNullString = @&quot;null&quot;;
 	return result;
 }
 
+- (BOOL)scanUnicodeCharacterIntoString:(NSMutableString *)string
+{
+  NSString *digits = [[self string] substringWithRange:NSMakeRange([self scanLocation], 4)];
+  /* START Updated code modified from code fix submitted by Bill Garrison
+           - March 28, 2006 - http://www.standardorbit.net */
+  NSScanner *hexScanner = [NSScanner scannerWithString:digits];
+  NSString *verifiedHexDigits;
+  NSCharacterSet *hexDigitSet = [NSCharacterSet characterSetWithCharactersInString:@&quot;0123456789ABCDEFabcdef&quot;];
+  if (NO == [hexScanner scanCharactersFromSet:hexDigitSet intoString:&amp;verifiedHexDigits]) {
+    return NO;
+  }
+  if (4 != [verifiedHexDigits length]) {
+    return NO;
+  }
+  
+  // Read in the hex value
+  [hexScanner setScanLocation:0];
+  unsigned unicodeHexValue;
+  if (NO == [hexScanner scanHexInt:&amp;unicodeHexValue]) {
+    return NO;
+  }
+  [string appendFormat:@&quot;%C&quot;, unicodeHexValue];
+  /* END update - March 28, 2006 */
+  return YES;
+}
+
+- (NSUInteger)locationOfString:(NSString *)searchedString
+{
+	// Since we have already scanned white space, we know that we're at the start of some value, and each of the strings
+	// is at most four characters, so just look ahead that many spaces. (In previous versions of the code, I was scanning
+	// ahead through the entire string, but this was incredibly expensive for long strings - adding massive amounts of
+	// time to scan way past the string we might care about)
+
+  NSUInteger scanLength = [[self string] length] - [self scanLocation];
+  scanLength = MIN(scanLength, searchedString.length);
+  NSRange searchRange = NSMakeRange([self scanLocation], scanLength);
+	return [[self string] rangeOfString:searchedString options:0 range:searchRange].location;
+}
+
 - (BOOL)scanJSONValue:(id *)value
 {
 	BOOL result = NO;
 	
 	[self scanJSONWhiteSpace];
 	
-	NSString *substring = [[self string] substringWithRange:NSMakeRange([self scanLocation], 1)];
-	
-	// Since we have already scanned white space, we know that we're at the start of some value, and each of the strings below is at most
-	// four characters, so just look ahead that many spaces. (In previous versions of the code, I was scanning ahead through the entire string, but this
-	// was incredibly expensive for long strings - adding massive amounts of time to scan way past the string we might care about)
-	NSUInteger scanLength = [[self string] length] - [self scanLocation];
-	if (scanLength &gt; [jsonTrueString length])
-		scanLength = [jsonTrueString length];
-	NSUInteger trueLocation = [[self string] rangeOfString:jsonTrueString options:0 range:NSMakeRange([self scanLocation], scanLength)].location;
-	
-	scanLength = [[self string] length] - [self scanLocation];
-	if (scanLength &gt; [jsonFalseString length])
-		scanLength = [jsonFalseString length];
-	NSUInteger falseLocation = [[self string] rangeOfString:jsonFalseString options:0 range:NSMakeRange([self scanLocation], scanLength)].location;
-	
-	scanLength = [[self string] length] - [self scanLocation];
-	if (scanLength &gt; [jsonNullString length])
-		scanLength = [jsonNullString length];
-	NSUInteger nullLocation = [[self string] rangeOfString:jsonNullString options:0 range:NSMakeRange([self scanLocation], scanLength)].location;
-	
+  NSUInteger scanLocation = [self scanLocation];
+  NSUInteger trueLocation = [self locationOfString:jsonTrueString];
+  NSUInteger falseLocation = [self locationOfString:jsonFalseString];
+  NSUInteger nullLocation = [self locationOfString:jsonNullString];
+  unichar currentCharacter = [[self string] characterAtIndex:scanLocation];
+  NSCharacterSet *digits = [NSCharacterSet decimalDigitCharacterSet];
+  NSString *substring = [NSString stringWithFormat: @&quot;%c&quot;, currentCharacter];
+
 	if ([substring isEqualToString:jsonStringDelimiterString]) {
 		result = [self scanJSONString:value];
 	} else if ([substring isEqualToString:jsonObjectStartString]) {
 		result = [self scanJSONObject:value];
 	} else if ([substring isEqualToString:jsonArrayStartString]) {
 		result = [self scanJSONArray:value];
-	} else if ([self scanLocation] == trueLocation) {
+	} else if (scanLocation == trueLocation) {
 		result = YES;
 		*value = [NSNumber numberWithBool:YES];
-		[self setScanLocation:([self scanLocation] + [jsonTrueString length])];
-	} else if ([self scanLocation] == falseLocation) {
+		[self setScanLocation:(scanLocation + jsonTrueString.length)];
+	} else if (scanLocation == falseLocation) {
 		result = YES;
 		*value = [NSNumber numberWithBool:NO];
-		[self setScanLocation:([self scanLocation] + [jsonFalseString length])];
-	} else if ([self scanLocation] == nullLocation) {
+		[self setScanLocation:(scanLocation + jsonFalseString.length)];
+	} else if (scanLocation == nullLocation) {
 		result = YES;
 		*value = [NSNull null];
-		[self setScanLocation:([self scanLocation] + [jsonNullString length])];
-	} else if (([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:[[self string] characterAtIndex:[self scanLocation]]]) ||
-			   ([[self string] characterAtIndex:[self scanLocation]] == '-')){ // check to make sure it's a digit or -
-		result =  [self scanJSONNumber:value];
+		[self setScanLocation:(scanLocation + jsonNullString.length)];
+	} else if (([digits characterIsMember:currentCharacter]) || (currentCharacter == '-')) {
+		result = [self scanJSONNumber:value];
 	}
 	return result;
 }</diff>
      <filename>NSScanner+BSJSONAdditions.m</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,6 @@
 //  Copyright 2009 Apple Inc.. All rights reserved.
 //
 
-#import &quot;NSDictionary+BSJSONAdditions.h&quot;
 #import &quot;NSScanner+BSJSONAdditions.h&quot;
 #import &quot;NSString+BSJSONAdditions.h&quot;
 
@@ -14,16 +13,11 @@
 
 + (NSString *)jsonIndentStringForLevel:(NSInteger)level
 {
-    NSMutableString *indentString = [[NSMutableString alloc] init];
-    if (level != jsonDoNotIndent) {
-        [indentString appendString:@&quot;\n&quot;];
-        NSInteger i;
-        for (i = 0; i &lt; level; i++) {
-            [indentString appendString:jsonIndentString];
-        }
-    }
-    
-    return [indentString autorelease];
+  if (level != jsonDoNotIndent) {
+    return [@&quot;\n&quot; stringByPaddingToLength:(level + 1) withString:jsonIndentString startingAtIndex:0];
+  } else {
+    return [NSString stringWithString: @&quot;&quot;];
+  }
 }
 
 - (NSString *)jsonStringValue
@@ -61,13 +55,13 @@
 			case '\t':
 				[jsonString appendString:@&quot;\\t&quot;];
 				break;
-				/* TODO: Find and encode unicode characters here?
-				 case '\u':
-				 [jsonString appendString:@&quot;\\n&quot;];
-				 break;
-				 */
+      /* TODO: Find and encode unicode characters here?
+      case '\u':
+        [jsonString appendString:@&quot;\\n&quot;];
+        break;
+        */
 			default:
-				[jsonString appendString:[NSString stringWithCharacters:&amp;nextChar length:1]];
+				[jsonString appendFormat:@&quot;%c&quot;, nextChar];
 				break;
 		}
 	}</diff>
      <filename>NSString+BSJSONAdditions.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>42f05dd55a6a1da8230eaa652f4cf05115b48d6a</id>
    </parent>
  </parents>
  <author>
    <name>Jakub Suder</name>
    <email>jakub.suder@gmail.com</email>
  </author>
  <url>http://github.com/blakeseely/bsjsonadditions/commit/560c3453284840620d2f40636880f07961e004dc</url>
  <id>560c3453284840620d2f40636880f07961e004dc</id>
  <committed-date>2009-05-26T13:41:25-07:00</committed-date>
  <authored-date>2009-05-26T13:37:39-07:00</authored-date>
  <message>refactoring in several classes

- extracted duplicated function jsonStringForValue from NSArray and
  NSDictionary into BSJSONParser
- moved some global variables from NSDictionary to NSScanner
- simplified jsonIndentStringForLevel in NSString
- extracted scanUnicodeCharacterIntoString from scanJSONObject
- extracted locationOfString from scanJSONValue
... and other minor fixes</message>
  <tree>e5b7949cba918e4290541fc63e15c34df71c0eef</tree>
  <committer>
    <name>Jakub Suder</name>
    <email>jakub.suder@gmail.com</email>
  </committer>
</commit>
