]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/convauto.cpp
Fix wxFileSystem::FileNameToURL() for Unicode file names.
[wxWidgets.git] / src / common / convauto.cpp
index c684613f4c93fa34c4cd667abc67f069184bd609..dde8af743e435a2c48a4f89bafd775b5017e5184 100644 (file)
@@ -107,11 +107,13 @@ wxConvAuto::BOMType wxConvAuto::DetectBOM(const char *src, size_t srcLen)
 
             if ( src[0] == '\x00' && src[1] == '\x00' )
             {
-                // this could only be UTF-32BE
-                if ( srcLen == 3 && src[2] == '\xFE' )
-                    return BOM_Unknown;
-            }
+                // this could only be UTF-32BE, check that the data we have so
+                // far allows for it
+                if ( srcLen == 3 && src[2] != '\xFE' )
+                    return BOM_None;
 
+                return BOM_Unknown;
+            }
             break;
 
         default: