incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Davis" <paul.joseph.da...@gmail.com>
Subject Re: problem with unicode
Date Mon, 02 Jun 2008 21:38:09 GMT
I also have a unicode issue I've been trying to track down.

Traceback:

[debug] [<0.56.0>] POST /wikipedia/_bulk_docs {1,1}
Headers: [{'Accept',"application/json"},
          {'Accept-Encoding',"identity"},
          {'Content-Length',"741"},
          {'Content-Type',"application/json"},
          {'Host',"localhost:5984"},
          {'User-Agent',"couchdb-python 0.3dev-r70"}]
[info] [<0.56.0>] HTTP Error (code 500): {'EXIT',
                           {if_clause,
                               [{xmerl_ucs,char_to_utf8,1},
                                {lists,flatmap,2},
                                {cjson,tokenize,2},
                                {cjson,decode1,2},
                                {cjson,decode_object,3},
                                {cjson,decode_array,3},
                                {cjson,decode_object,3},
                                {cjson,json_decode,2}]}}



On 6/2/08, Ryszard Szopa <ryszard.szopa@gmail.com> wrote:
> Hi,
>
> Whenever I try to do requests to CouchDB with Unicode characters in
> the content I get a 500 and an Erlang error. My Erlang is very weak,
> so even after reading the source of the function I believe the error
> comes from (tokenize in couchdb/cjson.erl) the error still doesn't
> make enough sense to fix it somehow.
>
> My session looks like this:
> my request:
>   URI -> "http://localhost:5984/blog"
>   CONTENT -> "{\"a\":\"ą\"}"
>   CONTENT-TYPE -> "application/json;charset=utf-8"
>
> CouchDB's answer:
>
> HEADERS -> ((:SERVER . "MochiWeb/1.0 (Any of you quaids got a smint?)")
>             (:DATE . "Mon, 02 Jun 2008 21:17:18 GMT")
>             (:CONTENT-TYPE . "text/plain;charset=utf-8")
>             (:CONTENT-LENGTH . "379"))
>   REASON -> "Internal Server Error"
>   STATUS-CODE -> 500
>   BODY ->
> "{\"error\":\"EXIT\",\"reason\":\"{function_clause,[{cjson,tokenize,[[],{decoder,unicode,null,1,9,comma}]},\\n
>                  {cjson,decode_object,3},\\n
> {cjson,json_decode,2},\\n
> {couch_httpd,handle_db_request,3},\\n
> {couch_httpd,handle_request,2},\\n
> {mochiweb_http,headers,4},\\n
> {proc_lib,init_p,5}]}\"}"
>
> It looks as if CouchDB was seeing something strange in place of the
> good old ą. At the same time, I have reasons to believe I've done
> everything I could to send UTF-8... Does anybody have any clue what
> kind of data can be causing this error?
>
> Thanks in advance for your help,
>
>     -- Richard
> --
> http://szopa.tasak.gda.pl/
>
Mime
View raw message