From 4c0c4c5a1c55d7d343e30d06ff5afc0ebf9ef0fd Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 18 Aug 2019 12:45:50 -0700 Subject: Switch from using utf8::is_bom to utf8::starts_with_bom Fixes #1816 --- src/textual.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/textual.cc') diff --git a/src/textual.cc b/src/textual.cc index 258e2560..4e24fd44 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -319,7 +319,9 @@ std::streamsize instance_t::read_line(char *& line) context.curr_pos = context.line_beg_pos; context.curr_pos += len; - if (context.linenum == 0 && utf8::is_bom(context.linebuf)) { + if (context.linenum == 0 && + utf8::starts_with_bom( + context.linebuf, context.linebuf + sizeof(context.linebuf))) { line = &context.linebuf[3]; len -= 3; } else { -- cgit v1.2.3