Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] EDICT dictionary on Kindle



On Sun, Dec 30, 2012 at 10:50:56AM +1100, Jim Breen wrote:
>
> ...
> failed to parse: ??? [??????] /(n) (arch) (obsc) (See ???) cutting off the leg
> at the knee (form of punishment in ancient China)/EntL2542160/
> #<ArgumentError: invalid byte sequence in US-ASCII>
> ...
>
> It seems that whatever locale is used by cron is not getting
> through to ruby, so it is defaulting to ASCII and chucking up
> on the UTF8 in the input file. The script has the usual
> "# encoding: UTF-8" as the first line, but that seem only to
> affect the script; not the data. Googling the problem shows
> a lot of discussion of the problem, but no cron-related
> solutions.
>
> I've tried all sorts of locale-setting fiddles, and tried several different
> shells, but nothing works.

Hello,

when forcing the local to en_us.ascii, I can see the ArgumentError.

This change works around it:

  https://github.com/jmettraux/edict2-kindle/commit/91e4bf2ae811aca39f0866d87771426a75667ae7

It forces the script to consider the input as UTF-8.


Best regards,

John



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links