rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.6k stars 254 forks source link

fix encoding error #91

Open icyblade opened 7 years ago

icyblade commented 7 years ago

UnicodeEncodeError will be raised if there are non-ansi characters(e.g. CJK) in the code. This PR will solve this problem by encoding codes with UTF-8.

rkern commented 7 years ago

The stream might have a different encoding. If the stream is sys.stdout, then it might have an .encoding attribute that can be inspected to find this out. UTF-8 cannot be assumed.

icyblade commented 7 years ago

@rkern Is this PR ready to be merged?