4

Possible Duplicate:
ASCII value of a character in python

The method I have applied is mapping the characters in an array . Is there a library for it ?

1
  • 2
    You mean transforming "extended" characters into their nearest ASCII representation, i. e. à to a, Ä to Ae (or AE?) and ß to ss? This is a hard problem. Commented Feb 8, 2011 at 13:33

2 Answers 2

3

ord() — or are you asking for something entirely different?

Given a string of length one, return an integer representing the Unicode code point of the character when the argument is a unicode object, or the value of the byte when the argument is an 8-bit string. … This is the inverse of chr() for 8-bit strings and of unichr() for unicode objects.

Sign up to request clarification or add additional context in comments.

2 Comments

chr() is the reverse, by the way.
@gokoon Yup, the excerpt from the docs says the same :)
1
ord('a') 

Displays the ascii value, assuming that's what you're asking. If you mean Unicode characters, then that's a bit more tricky - a mapping would be the best way to do it.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.