|
From: Yaroslav K. <kav...@je...> - 2005-05-30 10:52:09
|
Sam Steingold:
<skip>
> --- stream.d 19 May 2005 19:05:33 -0400 1.519
> +++ stream.d 27 May 2005 14:26:56 -0400
> @@ -4335,7 +4335,11 @@
> var size_t res = iconv(cd,&inptr,&insize,&outptr,&outsize);
> if (res == (size_t)(-1)) {
> var int my_errno = OS_errno;
> - if (my_errno == EILSEQ) { /* invalid input? */
> + if (my_errno == EILSEQ
> + #ifdef WIN32_NATIVE
> + || my_errno == ERROR_INVALID_HANDLE
> + #endif
> + ) { /* invalid input? */
> end_system_call();
> # ch not encodable -> finish the interval
> if (have_i1_i2) {
>
<skip>
> --- subtypep.lisp 09 Feb 2005 09:39:53 -0500 1.12
> +++ subtypep.lisp 27 May 2005 14:50:13 -0400
> @@ -1170,9 +1170,6 @@
> type)))
> ;; Conversion of an encoding to a list of intervals.
> #+UNICODE
> -(let ((table (make-hash-table :key-type '(or string symbol) :value-type
> 'simple-string
> - :test 'stablehash-equal
> :warn-if-needs-rehash-after-gc t)))
> - ;; cache: charset name -> list of intervals #(start1 end1 ... startm
> endm)
> #| ; Now in C and much more efficient.
> (defun charset-range (encoding start end)
> (setq start (char-code start))
> @@ -1192,19 +1189,16 @@
> ;; Return the definition range of a character set. If necessary,
> compute it
> ;; and store it in the cache.
> (defun get-charset-range (charset &optional maxintervals)
> + (let ((table #.(make-hash-table :key-type '(or string symbol)
> + :value-type 'simple-string
> + :test 'stablehash-equal
> + :warn-if-needs-rehash-after-gc t)))
> + ;; cache: charset name -> list of intervals #(start1 end1 ...
> startm endm)
> (or (gethash charset table)
> (setf (gethash charset table)
> (charset-range (make-encoding :charset charset)
> (code-char 0) (code-char (1-
> char-code-limit))
> - maxintervals))))
> - ;; Fill the cache, but cache only the results with small lists of
> intervals.
> - ;; Some iconv based encodings have large lists of intervals (up to
> 5844
> - ;; intervals for ISO-2022-JP-2) which are rarely used and not worth
> caching.
> - (do-external-symbols (sym (find-package "CHARSET"))
> - (let* ((charset (encoding-charset (symbol-value sym)))
> - (computed-range (get-charset-range charset 100))
> - (intervals (/ (length computed-range) 2)))
> - (when (>= intervals 100) (remhash charset table)))))
> + maxintervals)))))
> #| ;; Older code for a special case.
> ;; Test whether all characters encodable in encoding1 are also
> encodable in
> ;; encoding2.
RUN-ALL-TESTS: grand total: 1 error out of 10,422 tests
$ cat /home/src/clisp/clisp/build-full/tests/*.erg
Form: (IF *NO-ICONV-P* "AZ" (CONVERT-STRING-FROM-BYTES '#(255 254 65 0
13) (MAKE-ENCODING :CHARSET "utf-16" :INPUT-ERROR-ACTION #\Z)))
CORRECT: "AZ"
CLISP : ERROR
Win32 Error 6 (ERROR_INVALID_HANDLE): The handle is invalid.
Thanks.
--
WBR, Yaroslav Kavenchuk.
|