mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
jadecoder: remove charset check; now kakasi.py handle unknown chars better
This commit is contained in:
parent
444f53cb55
commit
411adb488c
@ -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:
|
||||
|
@ -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 = ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user