using #\DOUBLE_LOW-9_QUATATION_MARK in Url crashes Drakma #29

Closed
simkoc opened this Issue Jun 2, 2013 · 1 comment

Comments

Projects
None yet
2 participants

simkoc commented Jun 2, 2013

I encountered an error caused by non-Latin-1 characters used in a given url using sbcl e.g.:

(drakma:http-request "http://www.youtube.com/„weird-url")

debugger invoked on a FLEXI-STREAMS:EXTERNAL-FORMAT-ENCODING-ERROR       in thread
#<THREAD "initial thread" RUNNING {1002998D23}>:
#\DOUBLE_LOW-9_QUOTATION_MARK (code 8222) is not a LATIN-1 character.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(FLEXI-STREAMS::SIGNAL-ENCODING-ERROR
 #<FLEXI-STREAMS::FLEXI-LATIN-1-FORMAT (:ISO-8859-1 :EOL-STYLE :LF)
   {1002F196E3}>
 "~S (code ~A) is not a LATIN-1 character."
 #\DOUBLE_LOW-9_QUOTATION_MARK
 8222)

I am using Drakma 1.3.0 // SBCL 1.0.55 // flexis-streams 1.07

As a quickfix I replaced all +latin-1+ in "request.lisp" with (make-external-format :utf-8) but I doubt that this is a valid solution, as the +latin-1+ was chosen for a reason?

Owner

hanshuebner commented Jun 2, 2013

The encoding for headers is specified and requests is defined to be LATIN1 as per RFC2616. You need to properly encode your URL according to the rules of the server that you're talking to, for example using URL encoding UTF-8.

hanshuebner closed this Jun 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment