summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-11-24 18:16:20 (GMT)
committerGitHub <noreply@github.com>2019-11-24 18:16:20 (GMT)
commitdc20493b3351d79024f2f808d16f47a502346606 (patch)
tree7ba5e419b13e74ce645b9daf187e602c3259045c
parent73a410a00efb17ab7bc673bf2e3ecdc45eb876f4 (diff)
parent42355ace21f6fb72fba49316c73c025a12482b09 (diff)
downloadDoxygen-dc20493b3351d79024f2f808d16f47a502346606.zip
Doxygen-dc20493b3351d79024f2f808d16f47a502346606.tar.gz
Doxygen-dc20493b3351d79024f2f808d16f47a502346606.tar.bz2
Merge pull request #7416 from albert-github/feature/bug_UCS_BE
Problem converting UCS big endian file
-rw-r--r--src/util.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/util.cpp b/src/util.cpp
index f58a630..5868b62 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -8033,13 +8033,18 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
int start=0;
if (size>=2 &&
- (((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) || // Little endian BOM
- ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF) // big endian BOM
- )
- ) // UCS-2 encoded file
+ ((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) // Little endian BOM
+ ) // UCS-2LE encoded file
+ {
+ transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
+ "UCS-2LE","UTF-8");
+ }
+ else if (size>=2 &&
+ ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF) // big endian BOM
+ ) // UCS-2BE encoded file
{
transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
- "UCS-2","UTF-8");
+ "UCS-2BE","UTF-8");
}
else if (size>=3 &&
(uchar)inBuf.at(0)==0xEF &&