diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index d49cccd9..a46e71cf 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -1482,6 +1482,13 @@ iLocalDef iBool isNormalizableSpace_(char ch) { | |||
1482 | static void normalize_GmDocument(iGmDocument *d) { | 1482 | static void normalize_GmDocument(iGmDocument *d) { |
1483 | iString *normalized = new_String(); | 1483 | iString *normalized = new_String(); |
1484 | iRangecc src = range_String(&d->source); | 1484 | iRangecc src = range_String(&d->source); |
1485 | /* Check for a BOM. In UTF-8, the BOM can just be skipped if present. */ { | ||
1486 | iChar ch = 0; | ||
1487 | decodeBytes_MultibyteChar(src.start, src.end, &ch); | ||
1488 | if (ch == 0xfeff) /* zero-width non-breaking space */ { | ||
1489 | src.start += 3; | ||
1490 | } | ||
1491 | } | ||
1485 | iRangecc line = iNullRange; | 1492 | iRangecc line = iNullRange; |
1486 | iBool isPreformat = iFalse; | 1493 | iBool isPreformat = iFalse; |
1487 | if (d->format == plainText_SourceFormat) { | 1494 | if (d->format == plainText_SourceFormat) { |