jadecoder: remove charset check; now kakasi.py handle unknown chars better

This commit is contained in:
Hiroshi Miura 2011-02-05 16:16:15 +09:00
parent 444f53cb55
commit 411adb488c
2 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,6 @@ class Jadecoder(Unidecoder):
def decode(self, text):
try:
dummy = text.encode("eucjp") # test if text contains only Japanese and ASCII characters.
result=self.kakasi.do(text)
return re.sub('[^\x00-\x7f]', lambda x: self.replace_point(x.group()),result)
except:

View File

@ -53,7 +53,9 @@ class kakasi(object):
if self.j2h.isKanji(text[i]):
(t, l) = self.j2h.convert(text[i:])
if l <= 0:
break
otext = otext + text[i]
i = i + 1
continue
i = i + l
m = 0
tmptext = ""