[hunchentoot-devel] URL-DECODE Problem with MultiByte (> 255) Characters

Volkan YAZICI yazicivo at ttnet.net.tr
Wed Apr 25 23:01:38 UTC 2007


Hi,

While I was trying to issue some regression tests over my URI path
handling routine, I met with such a problem:

; Any character that's bigger than 255 reproduces the error.
KARPUZ> (code-char 305)
#\LATIN_SMALL_LETTER_DOTLESS_I
KARPUZ> (wiki-path-to :filename (wiki-path-from :uri "/image/foo/yok artık daha neler///.asd/&baz"))
; Evaluation aborted
KARPUZ> (hunchentoot:url-decode
          (make-string 1 :initial-element (code-char 305))
          (flex:make-external-format :utf8 :eol-style :lf))

The value 256 is not of type (UNSIGNED-BYTE 8).
   [Condition of type TYPE-ERROR]

Restarts:
 0: [ABORT] Return to SLIME's top level.
 1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {B2637B1}>)

Backtrace:
  0: (SB-KERNEL:HAIRY-DATA-VECTOR-SET #() 0 256)
      Locals:
        SB-DEBUG::ARG-0 = 3
        SB-DEBUG::ARG-1 = #()
        SB-DEBUG::ARG-2 = 0
        SB-DEBUG::ARG-3 = 256
  1: (VECTOR-PUSH 256 #())
      Locals:
        SB-DEBUG::ARG-0 = 2
        SB-DEBUG::ARG-1 = 256
        SB-DEBUG::ARG-2 = #()
  2: (URL-DECODE
      "Ā"
      #<FLEXI-STREAMS::EXTERNAL-FORMAT (:UTF-8 :EOL-STYLE :LF) {AE0D729}>)
      Locals:
        HUNCHENTOOT::EXTERNAL-FORMAT = #<FLEXI-STREAMS::EXTERNAL-FORMAT (:UTF-8 :EOL-STYLE :LF) {AE0D729}>
        STRING = "Ā"

Would somebody help me to fix the error please?


Regards.



More information about the Tbnl-devel mailing list