[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] string-ref problem
From: |
Joerg F. Wittenberger |
Subject: |
Re: [Chicken-users] string-ref problem |
Date: |
11 Jan 2003 23:33:14 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) |
felix <address@hidden> writes:
> Joerg F. Wittenberger wrote:
> > #define C_character_code(x) (((x) >> 8) & 0xffff)
> > is there any reason not to change back?
>
> This was, in fact, a preparatory "fix" for allowing 16-bit characters.
> But it turned out to break "C_subchar()" which extracts a char from
> a string and treated it as signed.
>
> I fixed the latter, so the current CVS version should work, now.
Not sure about that. I have:
(string-for-each
(lambda (c) (display (vector-ref mapping (char->integer c)) port))
obj)
where mapping is a vector:
(define html-encoding (make-vector 256 "[unknown]"))
and I see:
Sat, 11 Jan 2003 23:34:21 +0100 HTTP EXCEPTION exception out of range (#("" ""
"" "" "" "" "" "" " " " "
" "
" "
" "" "" "" "" "" "" "" "" "" "" "" "" "" " "" "" "" "" " " "!" """ "#" "$"
"%" "&" "'" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" "6" "7"
"8" "9" ":" ";" "<" "=" ">" "?" "@" "A" "B" "C" "D" "E" "F" "G" "H" "I"
"J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" "[" "\\"
"]" "^" "_" "`" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p"
"q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~" "" "" "" "" "" ""
"
" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
"" "" "" "" "" "" "" " " "¡" "¢" "£" "¤" "¥" "¦" "§" "¨" "©" "ª"
"«" "¬" "" "®" "¯" "°" "±" "²" "³" "´" "µ" "¶" "·" "¸" "¹" "º" "»" "¼" "½" "¾"
"¿" "À" "Á" "Â" "Ã" "Ä" "Å" "Æ" "Ç" "È" "É" "Ê" "Ë" "Ì" "Í" "Î" "Ï" "Ð" "Ñ" "Ò"
"Ó" "Ô" "Õ" "Ö" "×" "Ø" "Ù" "Ú" "Û" "Ü" "Ý" "Þ" "ß" "à" "á" "â" "ã" "ä" "å" "æ"
"ç" "è" "é" "ê" "ë" "ì" "í" "î" "ï" "ð" "ñ" "ò" "ó" "ô" "õ" "ö" "÷" "ø" "ù" "ú"
"û" "ü" "ý" "þ" "ÿ") 65526)
I'm pretty sure the char->integer result should be != 65526.
But I understand that it might be a chicken-and-egg problem, where the
compiler compiled itself. Either something went wrong, I compiled the
wrong code (unlikely, but you never know), or there is one more thing
to fix.
Cheers
/Jörg
--
The worst of harm may often result from the best of intentions.