ICU-66108.tar.gz
[apple/icu.git] / icuSources / tools / toolutil / xmlparser.cpp
index 134fdcf8d0911929040cd3e49a7a5dd5353ecd88..a9650cc599927f26be11a8f1d014ded0c534e312 100644 (file)
@@ -1,3 +1,5 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 *
@@ -6,7 +8,7 @@
 *
 *******************************************************************************
 *   file name:  xmlparser.cpp
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:4
 *
@@ -207,7 +209,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
             goto exit;
         }
 
-        buffer=src.getBuffer(bytesLength);
+        buffer=toUCharPtr(src.getBuffer(bytesLength));
         if(buffer==NULL) {
             // unexpected failure to reserve some string capacity
             errorCode=U_MEMORY_ALLOCATION_ERROR;
@@ -276,7 +278,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
         pb=bytes;
         for(;;) {
             length=src.length();
-            buffer=src.getBuffer(capacity);
+            buffer=toUCharPtr(src.getBuffer(capacity));
             if(buffer==NULL) {
                 // unexpected failure to reserve some string capacity
                 errorCode=U_MEMORY_ALLOCATION_ERROR;
@@ -311,7 +313,7 @@ UXMLParser::parseFile(const char *filename, UErrorCode &errorCode) {
             // reached end of file, convert once more to flush the converter
             flush=TRUE;
         }
-    };
+    }
 
 exit:
     ucnv_close(cnv);