-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling invalid UTF-8 bytes #38
Comments
Non-utf8 8-bit C1 escapes should be passed to |
Here's a more specific testcase: $ echo -e '\x90' > test.txt
$ target/debug/examples/parselog < test.txt
[execute] 0a
$ The 0x90 byte is silently dropped with no |
So escapes like |
I don't actually want to interpret C1 controls in my use case; I want to replace all non-UTF-8 bytes into replacement characters. Right now, vte doesn't support that, either for bytes like 0x90 which are C1 controls, or bytes like 0xfd which are not. Is this a use case vte is interested in supporting? |
I'm not sure if it's possible to support that without removing existing functionality. Take things like the You could just handle |
Yes, that's what I want to do. It's ok if vte reports these bytes through Specifically, I want to do this for both C1 codes like 0x90, and non-C1 codes like 0xfd. I can cope if these two cases are reported differently, and it's even ok if the API doesn't tell me what the actual bytes are, as long as it provides indications that such bytes were processed. |
For actually invalid UTF-8, we already print error glyphs (see For these specific bytes it would be possible to propagate them to the |
I'm looking at using vte for a use case where I want to translate invalid UTF-8 bytes into Unicode replacement characters, however vte seem to silently swallow some invalid UTF-8 bytes. For example, if I feed it input consisting of the byte 0x90, it produces no events.
Would it make sense to add
Execute
rules to theGround
table for 0x90 and other formerly special C1 codes?Would it make sense to introduce something like a
InvalidUtf8
action, to fill in theGround
table in general?The text was updated successfully, but these errors were encountered: