Skip to content
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

io:format string rendering for bytes >= 0x8E #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

mcesaro
Copy link

@mcesaro mcesaro commented May 18, 2020

I found an issue when rendering strings containing bytes >= 0x8E with io:format("~s"), at least when beam is started with the default latin1 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.^....

@aerosol
Copy link
Member

aerosol commented Jul 1, 2020

@mcesaro Thank you. Could you please rebase your work in this PR? I'm seeing my commits from gh-pages branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants