forked from mia/Aegisub
Handle partial characters at the end of the read buffer when loading Lua scripts. Closes #1576.
This commit is contained in:
parent
1f5484fedb
commit
959be0a64a
1 changed files with 2 additions and 0 deletions
|
@ -47,6 +47,8 @@ namespace Automation4 {
|
||||||
size_t out_bytes = sizeof(buf);
|
size_t out_bytes = sizeof(buf);
|
||||||
|
|
||||||
conv->Convert(&in, &in_bytes, &out, &out_bytes);
|
conv->Convert(&in, &in_bytes, &out, &out_bytes);
|
||||||
|
if (in_bytes > 0 && in != in_buf)
|
||||||
|
file.seekg(-(std::streamoff)in_bytes, std::ios_base::cur);
|
||||||
*bytes_read = out - buf;
|
*bytes_read = out - buf;
|
||||||
|
|
||||||
// Skip the bom
|
// Skip the bom
|
||||||
|
|
Loading…
Reference in a new issue