By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

Create Unicode object problem

P: n/a
Hi!

Is there any way I can create a unicode object from the unicode code
itself.
I extract the code from a file and need to create a unicode object
that represents the corresponding character.

So what i get from reading my file is a string containing for example
the code 'u8c79' (Chinese character).

Help on this would be appreciated!

Kathy
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Kathy wrote:
Is there any way I can create a unicode object from the unicode code
itself.
I extract the code from a file and need to create a unicode object
that represents the corresponding character.

So what i get from reading my file is a string containing for example
the code 'u8c79' (Chinese character).

unichr(eval('u8c79'.replace('u','0x')))

u'\u8c79'
--irmen
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.