Python Forum
tool wanted: to convert utf8 <-> unicode in hex
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tool wanted: to convert utf8 <-> unicode in hex
#6
(May-21-2018, 03:06 AM)wavic Wrote:
Quote:so how does this convert to utf8?
>>> chr(int('0x42f', 16))
'Я'

what non-python tool does it use to do such conversion?

what program is this being run under? out of speculation, i tried running this under python3.5.2 but did not get the same results:
Output:
lt1/forums /home/forums 11> python3 Python 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> chr(int('0x42f', 16)) '\u042f' >>> lt1/forums /home/forums 12>
i am going to be running this to verify if i am getting the correct conversion in python. ideally this would be a command that has the actual conversion code in it. so there woul e some form of bit operations or the arithmetic equivalent (*2 is like a left shift of 1)
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: tool wanted: to convert utf8 <-> unicode in hex - by Skaperen - May-21-2018, 03:46 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020