From 54e2064fe970796247724e277159d8ca04104355 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Wed, 23 Apr 2014 20:48:37 +0800 Subject: [PATCH] Don't assume the encoding of a large file is UTF-8 --- src/xmlcopyeditor.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index f44ce6d..10e79f1 100644 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -3079,11 +3079,7 @@ bool MyFrame::openFile ( wxString& fileName, bool largeFile ) size_t finalBufferLen; std::string encoding; - if ( largeFile ) - { - encoding = "UTF-8"; - } - else if ( docBufferLen >= 4 && // UTF-32 BE + if ( docBufferLen >= 4 && // UTF-32 BE ( unsigned char ) docBuffer[0] == 0x00 && ( unsigned char ) docBuffer[1] == 0x00 && ( unsigned char ) docBuffer[2] == 0xFE &&