mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-2825 process escapes; only remove BOM at start of file
X-SVN-Rev: 14974
This commit is contained in:
parent
29bfb5542a
commit
112f613306
1 changed files with 5 additions and 4 deletions
|
@ -101,12 +101,13 @@ UBool TextFile::readLine(UnicodeString& line, UErrorCode& ec) {
|
|||
if (!setBuffer(n++, c, ec)) return FALSE;
|
||||
}
|
||||
if (!setBuffer(n++, 0, ec)) return FALSE;
|
||||
line = UnicodeString(buffer, encoding);
|
||||
if (line[0] == 0xFEFF) {
|
||||
/* Remove any UTF BOMs */
|
||||
line.replaceBetween(0,1,"");
|
||||
UnicodeString str(buffer, encoding);
|
||||
// Remove BOM in first line, if present
|
||||
if (lineNo == 0 && str[0] == 0xFEFF) {
|
||||
str.remove(0, 1);
|
||||
}
|
||||
++lineNo;
|
||||
line = str.unescape();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue