Skip to content

Conversation

@KyongSik-Yoon
Copy link

UnicodeEncodeError occurred when collapsed result append to file as like below

./stackcollapse_hprof_original.py out.hprof > collapsed.txt
Traceback (most recent call last):
File "./stackcollapse_hprof_original.py", line 207, in
main()
File "./stackcollapse_hprof_original.py", line 201, in main
print(line, file=out)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 704: ordinal not in range(128)

My operating system is Mac OS.
I expect collapsed result is not encoded to utf-8.
So I tried just encode each of result line. After do this it's working well.

UnicodeEncodeError occurred when collapsed result append to file as like below
---
./stackcollapse_hprof_original.py out.hprof > collapsed.txt
Traceback (most recent call last):
  File "./stackcollapse_hprof_original.py", line 207, in <module>
    main()
  File "./stackcollapse_hprof_original.py", line 201, in main
    print(line, file=out)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 704: ordinal not in range(128)

My operating system is Mac OS.
I expect collapsed result is not encoded to utf-8.
So I tried just encode each of result line. After do this it's working well.
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.

1 participant