io:format string rendering for bytes >= 0x8E #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found an issue when rendering strings containing bytes >= 0x8E with
io:format("~s")
, at least when beam is started with the defaultlatin1
printable_range/1
.To fix it, I added an additional condition in the guard inside the print_bucket/1 function at line 136:
Code when Code >= ?SPACE, Code =< 16#7F -> Code;
Without the additional condition:
0001 30 01 07 06 68 45 45 68 08 01 72 27 39 10 20 8F 0...hEEh..r'9.
With the condition:
0001 30 01 07 06 68 45 45 68 08 01 72 27 39 10 20 8F 0...hEEh..r'9. .
Also:
Before:
001C 00 00 00 0C 22 64 05 00 00 06 6D 36 34 10 9E 24 ...."d....m64..÷.2.ÿ..r...
001E 1E FD E6 00 A2 26 B4 0A 00 00 6E 00 92 18 00 00 .ýæ.¢&´...n....
001F 93 FF 4D C0 7F 03 06 1F 17 ÿMÀ^....
After:
001C 00 00 00 0C 22 64 05 00 00 06 6D 36 34 10 9E 24 ...."d....m64..$
001D 00 0F D0 10 F7 16 32 16 FF 19 93 00 72 01 11 17 ......2.....r...
001E 1E FD E6 00 A2 26 B4 0A 00 00 6E 00 92 18 00 00 .....&....n.....
001F 93 FF 4D C0 7F 03 06 1F 17 ..M.^....