in reply to Re^2: Processing an encoded file backwards
in thread Processing an encoded file backwards
As you can see in my demo in the other answer is Encode using "\x{FFFD}" to decode the broken character. When it's reliable° in doing so, this could lead to better code.
Well, to be purist about it (emphasis mine):
If CHECK is 0, encoding and decoding replace any malformed character with a substitution character.
So it doesn't allow you to differentiate between a character that was broken by the read, and an actually malformed input file.
Update:
Not sure what other multi-byte encodings are out there...
Me neither, but I think UTF-8 and UTF-16 would already cover a lot of what's out there today.
As you can see in my demo in the other answer
I don't use the debugger often, so reading its output doesn't come naturally to me ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Processing an encoded file backwards (updated)
by LanX (Saint) on Jan 18, 2020 at 21:16 UTC | |
by haukex (Archbishop) on Jan 18, 2020 at 21:53 UTC | |
by LanX (Saint) on Jan 18, 2020 at 22:30 UTC | |
by choroba (Cardinal) on Jan 18, 2020 at 23:13 UTC | |
by LanX (Saint) on Jan 18, 2020 at 23:27 UTC | |
by LanX (Saint) on Jan 18, 2020 at 23:19 UTC | |
|