Skip to content

Error messages may be invalid UTF8 #1734

@Spacechild1

Description

@Spacechild1

If you try to run a script and there is an error, sol2 gives you an error message that indicates the source of the problem. The offending line of code is truncated above a certain number of bytes, indicated by 3 trailing dots. However, if the last byte happens to be the start of a UTF8 sequence, you may end up with an invalid UTF8 string.

For example, the UTF8 sequence for the letter ö is 0xC3 0xB6. sol2 may end the string on 0xC3 and append 0x2e 0x2e 0x2e (...), which is not valid UTF8 (invalid continuation byte).

I'm not sure who is responsible for wrong truncation, sol2 or Lua itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions