OSDN Git Service

Use 'US-ASCII' as the default charset for ExifParser
authorEarl Ou <shunhsingou@google.com>
Thu, 18 Oct 2012 07:58:01 +0000 (15:58 +0800)
committerEarl Ou <shunhsingou@google.com>
Wed, 24 Oct 2012 03:13:21 +0000 (11:13 +0800)
Change-Id: I775c84e601f8d33010080b189efd8c2de00d6959

gallerycommon/src/com/android/gallery3d/exif/ExifParser.java

index f1e52c5..56f722a 100644 (file)
@@ -650,14 +650,14 @@ public class ExifParser {
     }
 
     /**
-     * Reads a String from the InputStream with UTF8 charset.
+     * Reads a String from the InputStream with US-ASCII charset.
      * This is used for reading values of type {@link ExifTag#TYPE_ASCII}.
      */
     public String readString(int n) throws IOException {
         if (n > 0) {
             byte[] buf = new byte[n];
             mTiffStream.readOrThrow(buf);
-            return new String(buf, 0, n - 1, "UTF8");
+            return new String(buf, 0, n - 1, "US-ASCII");
         } else {
             return "";
         }