Permalink
Browse files

Update Source/Tidy/CTidy.m

  • Loading branch information...
1 parent fde41b1 commit 1c59eca400408f45a8075f6113a40078ee8b54ea @AdamBuckley committed Oct 15, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 Source/Tidy/CTidy.m
View
@@ -71,7 +71,10 @@ - (NSData *)tidyData:(NSData *)inData inputFormat:(CTidyFormat)inInputFormat out
theResultCode = tidyOptSetBool(theTidyDocument, TidyForceOutput, YES);
NSAssert(theResultCode >= 0, @"tidyOptSetBool() should return 0");
-theResultCode = tidySetOutCharEncoding(theTidyDocument, "utf8");
+// Set encoding - same for input and output
+theResultCode = tidySetInCharEncoding(theTidyDocument, encoding)
+NSAssert(theResultCode >= 0, @"tidySetInCharEncoding() should return 0");
+theResultCode = tidySetOutCharEncoding(theTidyDocument, encoding);
NSAssert(theResultCode >= 0, @"tidySetOutCharEncoding() should return 0");
// Create an error buffer
@@ -165,7 +168,10 @@ - (NSString *)tidyString:(NSString *)inString inputFormat:(CTidyFormat)inInputFo
theResultCode = tidyOptSetBool(theTidyDocument, TidyForceOutput, YES);
NSAssert(theResultCode >= 0, @"tidyOptSetBool() should return 0");
-theResultCode = tidySetCharEncoding(theTidyDocument, "utf8");
+// Set encoding - same for input and output
+theResultCode = tidySetInCharEncoding(theTidyDocument, encoding)
+NSAssert(theResultCode >= 0, @"tidySetInCharEncoding() should return 0");
+theResultCode = tidySetOutCharEncoding(theTidyDocument, encoding);
NSAssert(theResultCode >= 0, @"tidySetOutCharEncoding() should return 0");
// Create an error buffer

0 comments on commit 1c59eca

Please sign in to comment.