Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 5e28454

Browse files
committed
remove check for UTF16/32 when there is no BOM
1 parent 1a7bf4f commit 5e28454

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

appshell/appshell_extensions_win.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -757,12 +757,8 @@ bool hasUTF16_32(UTFValidationState& validationState)
757757

758758
// Check to see if buffer is UTF-16 or UTF-32 with or without a BOM
759759
BOOL test = IsTextUnicode(validationState.data, validationState.dataLen, &flags);
760-
// The check for IsTextUnicode could return FALSE but some bits turned on in the
761-
// flags result when statstical analysis is applied. treat those as UTF16 / UTF32
762-
// since we are only looking for UTF8 data which always fails with flags == 0
763-
bool result = ((test != FALSE) || (flags > 0));
764760

765-
validationState.utf1632 = (result ? CS_YES : CS_NO);
761+
validationState.utf1632 = ((test != FALSE) ? CS_YES : CS_NO);
766762
}
767763

768764
return (validationState.utf1632 == CS_YES);

0 commit comments

Comments
 (0)