473,395 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Missing unicode data?

Hi group,

I just came across the following exception:

#v+

$ python
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import unicodedata
u'\N{LATIN LETTER SMALL CAPITAL BARRED B}' UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 0-38: unknown Unicode character name unicodedata.name(u'\u1d03') Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: no such name ^D

$

#v-

When checking unicodedata.name() against each uchar in the file
/usr/share/unidata/UnicodeData-4.0.1d1b.txt that came with the
console-data package on my Ubuntu Linux installation a total of
1226 unicode characters seems to be missing from the unicodedata
module (2477 missing characters when checking against the latest
database from unicode.org¹). Is this a deliberate omission?

Cheers,
Klaus.

¹) http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
--
Klaus Alexander Seistrup
SubZeroNet, Copenhagen, Denmark
http://magnetic-ink.dk/
Jun 3 '06 #1
2 2266
Klaus Alexander Seistrup wrote:
When checking unicodedata.name() against each uchar in the file
/usr/share/unidata/UnicodeData-4.0.1d1b.txt that came with the
console-data package on my Ubuntu Linux installation a total of
1226 unicode characters seems to be missing from the unicodedata
module (2477 missing characters when checking against the latest
database from unicode.org¹). Is this a deliberate omission?


I'm pretty sure unicodename.name() doesn't look in the UnicodeData file
on your machine, nor in the latest file from unicode.org. in other
words, you get whatever version that was used to create the Unicode data
set in your Python distribution.

this is usually the version that was current when that Python version
was originally released (i.e. in your case, when 2.4 was released).

iirc, 2.4 uses Unicode 3.2, and 2.5 uses Unicode 4.1. to update, use
the tools under Tools/unicode.

</F>

Jun 3 '06 #2
Fredrik Lundh skrev:
I'm pretty sure unicodename.name() doesn't look in the Unicode-
Data file on your machine, nor in the latest file from unicode.org.
I am pretty sure of that, too. I was only using those files as a
reference against the unicode data that comes with my python interpreter.
in other words, you get whatever version that was used to create
the Unicode data set in your Python distribution.
I see.
iirc, 2.4 uses Unicode 3.2, and 2.5 uses Unicode 4.1. to update,
use the tools under Tools/unicode.


Thanks for the hint.

Mvh,

--
Klaus Alexander Seistrup
SubZeroNet, Copenhagen, Denmark
http://magnetic-ink.dk/
Jun 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
2
by: Harish Mohanbabu | last post by:
Hi, I have got couple of questions about unicode settings for database and I would be thankful if someone can clear the same for me. Here I go - a. How can I find out whether unicode has been...
4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
1
by: anantvrana | last post by:
Hello All, I am trying to read Unicode (Kanji character) data from a text file. When I store unicode data into variable my Kanji character gets messed up. I am using following code Open...
6
by: John Sidney-Woollett | last post by:
Hi I need to store accented characters in a postgres (7.4) database, and access the data (mostly) using the postgres JDBC driver (from a web app). Does anyone know if: 1) Is there a...
0
by: Klaus Alexander Seistrup | last post by:
Hi group, I just came across the following exception: #v+ $ python Python 2.4.2 (#2, Sep 30 2005, 21:19:01) on linux2 Type "help", "copyright", "credits" or "license" for more...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
3
by: gudiya | last post by:
hi, My code works but i am missing the first 2 characters of file name. Any idea why???? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;...
1
by: Mudcat | last post by:
In short what I'm trying to do is read a document using an xml parser and then upload that data back into a database. I've got the code more or less completed using xml.etree.ElementTree for the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.