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
73cc2d21c6
commit
0e3b383c4b
1 changed files with 2 additions and 0 deletions
|
@ -50,6 +50,8 @@ namespace Automation4 {
|
|||
size_t out_bytes = sizeof(buf);
|
||||
|
||||
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;
|
||||
|
||||
// Skip the bom
|
||||
|
|
Loading…
Reference in a new issue