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

Interpret input as UTF-8 #133

Merged
merged 1 commit into from
May 21, 2017
Merged

Conversation

jackvreeken
Copy link
Contributor

Using the pragma open option, we can interpret both stdin and input
files as UTF-8 without having to explicitly open them first.

Using the pragma open option, we can interpret both stdin and input
files as UTF-8 without having to explicitly open them first.
@jackvreeken
Copy link
Contributor Author

jackvreeken commented May 9, 2017

I ran into UTF-8 interpretation issues. After searching around a bit, I implemented the solution from this post. This should solve issue 86.

I assumed we want to open every file as UTF-8. I do not know perl well enough to also support other encodings by e.g. adding a commandline argument.

@brendangregg
Copy link
Owner

Thanks, this works. Was hard to reproduce, but I got it in the end: the problem was with unicode characters in the elide code which turns a long function name, eg, "abcdef" into "ab...".

@brendangregg brendangregg merged commit 91eba1a into brendangregg:master May 21, 2017
@jackvreeken
Copy link
Contributor Author

Ah, sorry about that. I probably should have included an example. It was indeed that part of the Perl code that did not work correctly, as it was slicing on code points instead of code units (not knowing any better). Interestingly enough, the JavaScript code for the ellipses worked correctly, as zooming in and out again fixed it. I guess this is because it was interpreting everything as UTF-8 all along.

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