summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-08-10 12:20:52 (GMT)
committerGitHub <noreply@github.com>2018-08-10 12:20:52 (GMT)
commitc82abe1f23ec55aa1d05f118c2bae3aac3b68296 (patch)
treec8a179c5f994f9760b23de4334784e0286251ed4 /src/util.cpp
parent69829b043fb36a56d194dc31522b694379636855 (diff)
parentf3b423989086728ded99492e61a0a5c127f21f69 (diff)
downloadDoxygen-c82abe1f23ec55aa1d05f118c2bae3aac3b68296.zip
Doxygen-c82abe1f23ec55aa1d05f118c2bae3aac3b68296.tar.gz
Doxygen-c82abe1f23ec55aa1d05f118c2bae3aac3b68296.tar.bz2
Merge pull request #6437 from albert-github/feature/bug_ucs_2
Automatic detection of UCS-2 based on BOM corrected
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 6c7e3d5..b387a84 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -7949,8 +7949,8 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
int start=0;
if (size>=2 &&
- ((inBuf.at(0)==-1 && inBuf.at(1)==-2) || // Little endian BOM
- (inBuf.at(0)==-2 && inBuf.at(1)==-1) // big endian BOM
+ (((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
{