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):
|
def decode(self, text):
|
||||||
try:
|
try:
|
||||||
dummy = text.encode("eucjp") # test if text contains only Japanese and ASCII characters.
|
|
||||||
result=self.kakasi.do(text)
|
result=self.kakasi.do(text)
|
||||||
return re.sub('[^\x00-\x7f]', lambda x: self.replace_point(x.group()),result)
|
return re.sub('[^\x00-\x7f]', lambda x: self.replace_point(x.group()),result)
|
||||||
except:
|
except:
|
||||||
|
@ -53,7 +53,9 @@ class kakasi(object):
|
|||||||
if self.j2h.isKanji(text[i]):
|
if self.j2h.isKanji(text[i]):
|
||||||
(t, l) = self.j2h.convert(text[i:])
|
(t, l) = self.j2h.convert(text[i:])
|
||||||
if l <= 0:
|
if l <= 0:
|
||||||
break
|
otext = otext + text[i]
|
||||||
|
i = i + 1
|
||||||
|
continue
|
||||||
i = i + l
|
i = i + l
|
||||||
m = 0
|
m = 0
|
||||||
tmptext = ""
|
tmptext = ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user