Example database menu item

svn: r1413
This commit is contained in:
Don Allingham
2003-03-31 01:33:40 +00:00
parent 1895853627
commit 223be201c5
15 changed files with 395 additions and 359 deletions

View File

@@ -278,7 +278,6 @@ _utoa = {
def ansel_to_utf8(s):
"""Converts an ANSEL encoded string to UTF8"""
print s
buff = cStringIO.StringIO()
while s:
c0 = ord(s[0])
@@ -288,23 +287,18 @@ def ansel_to_utf8(s):
elif c0 > 127:
l2 = s[0:2]
l1 = s[0]
print "----------------------"
if _twobyte.has_key(l2):
head = _twobyte[l2]
s = s[2:]
print "two"
elif _onebyte.has_key(l1):
head = _onebyte[l1]
s = s[1:]
print "**8 one",l1,ord(l1),"*",_onebyte[l1],
else:
head = u'\xff\xfd'
s = s[1:]
print "barf"
else:
head = s[0]
s = s[1:]
print head,c0
buff.write(head)
ans = buff.getvalue()
buff.close()