With python you can lookup each unicode character by its integer code using unichr.
import sys
with open('unicode.csv','wb') as output:
for i in xrange(sys.maxunicode):
output.write(unicode(i))
output.write(u',')
output.write(unichr(i).encode('utf-8'))
output.write(u',')
output.write(unichr(i).encode('ascii', 'xmlcharrefreplace'))
output.write(u'\n')
print sys.maxunicode
This gives you a file (unicode.csv) which has the unciode integer, unicode representation, unicode character, and HTML escaped character (for non-ascii).
For example, each line looks like this:
64058,u'\ufa3a',墨,墨
I put the code and the unicode.csv file on github for easier access.
Note: Because the unicode character set includes newline characters, CSV is not really the best format. (See lines 10 to 13.) I also added a python code to generate a JSON file, which is more safe than CSV for storing unicode characters.
&#x<HEX>;
, where<HEX>
is the Unicode codepoint in hex (the first column of the UnicodeData.txt file, with or without leading zeros)