emacs-devel
[Top][All Lists]
Advanced

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

Re: Fwd: parse-time-string error with non ASCII timestamp


From: Andreas Schwab
Subject: Re: Fwd: parse-time-string error with non ASCII timestamp
Date: Tue, 17 Apr 2007 13:33:23 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.97 (gnu/linux)

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, "Levin Du" <address@hidden> writes:
> [...]
>>    My timestamp includes Chinese number, when the following executes:
>
>>     (parse-time-string "<2007-04-02 一>")  ; the 12nd char is the
>> Chinese number.
>
>> An error will occur:
>
>> Debugger entered--Lisp error: (args-out-of-range [nil nil nil nil nil
>> nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
> [...]
>> This is a patch I wrote to solve this problem:
>> *** /home/zslevin/Cook/emacs/lisp/calendar/parse-time.el.orig
>> 2007-04-02 10:01:27.000000000 +0800
>> --- /home/zslevin/Cook/emacs/lisp/calendar/parse-time.el        2007-04-02
>> 15:35:07.000000000 +0800
>> ***************
>> *** 66,72 ****
>>     (aref parse-time-digits char))
>
>>   (defsubst parse-time-string-chars (char)
>> !   (aref parse-time-syntax char))
>
>>   (put 'parse-error 'error-conditions '(parse-error error))
>>   (put 'parse-error 'error-message "Parsing error")
>> --- 66,73 ----
>>     (aref parse-time-digits char))
>
>>   (defsubst parse-time-string-chars (char)
>> !   (and (< char (length parse-time-syntax))
>> !        (aref parse-time-syntax char)))
>
> It seems that this is the right fix at the moment because
> parse-time.el doesn't pay attention to non-ASCII characters
> at all.   In the future, we may have to improve it for
> non-ASCII characters if necesary.

I'd guess all that needs to be done is to make parse-time-digits and
parse-time-syntax char tables.

> Shall I install that change?

digit-char-p has the same problem.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]