Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issues with UTF8 Strings as ressource (bad_utf8_character_code) #491

Open
bitcloud opened this Issue · 2 comments

3 participants

@bitcloud

There seems to be a Problem with storing records with UTF8 chars in the URI
A quick curl samlpe for that is:

Insert Key:

curl -X PUT http://localhost:8098/riak/test/testäöü -H 'content-type: application/json' -v

Check if inserted:

curl -X GET http://localhost:8098/riak/test/testäöü -v

This one breaks:

curl -X POST "http://localhost:8098/mapred" -H "Content-Type: application/json" -d '{"inputs": "test","query":[{"map":{"name":"Riak.mapValuesJson","language":"javascript"}}]}' -v

This is the response:

* Adding handle: conn: 0x7fa3c180ee00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fa3c180ee00) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8098 (#0)
*   Trying ::1...
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8098 (#0)
> POST /mapred HTTP/1.1
> User-Agent: curl/7.30.0
> Host: localhost:8098
> Accept: */*
> Content-Type: application/json
> Content-Length: 90
>
* upload completely sent off: 90 out of 90 bytes
< HTTP/1.1 500 Internal Server Error
* Server MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) is not blacklisted
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
< Date: Thu, 13 Feb 2014 15:33:06 GMT
< Content-Type: text/html
< Content-Length: 1312
<
<html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1>The server encountered an error while processing this request:<br><pre>{error,{exit,{ucs,{bad_utf8_character_code}},
             [{xmerl_ucs,from_utf8,1,[{file,"xmerl_ucs.erl"},{line,185}]},
              {mochijson2,json_encode_string,2,
                          [{file,"src/mochijson2.erl"},{line,186}]},
              {mochijson2,'-json_encode_proplist/2-fun-0-',3,
                          [{file,"src/mochijson2.erl"},{line,167}]},
              {lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
              {mochijson2,json_encode_proplist,2,
                          [{file,"src/mochijson2.erl"},{line,170}]},
              {riak_kv_wm_mapred,send_error,2,
                                 [{file,"src/riak_kv_wm_mapred.erl"},
                                  {line,70}]},
              {riak_kv_wm_mapred,pipe_mapred_nonchunked,3,
                                 [{file,"src/riak_kv_wm_mapred.erl"},
                                  {line,214}]},
              {webmachine_resource,resource_call,3,
                                   [{file,"src/webmachine_resource.erl"},
* Connection #0 to host localhost left intact
                                    {line,186}]}]}}</pre><P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></body></html>%
@jaredmorrow

/cc @macintux, he just spent some time debugging UTF8 issues, but I think that was in regards to security. I'll leave this here for now and put it on the 2.1 milestone.

@jaredmorrow jaredmorrow added this to the 2.1 milestone
@jrwest

I believe its a known issue that Riak's erlang_js does not support unicode cc/ @cmeiklejohn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.