I need to escape the "ñ" #3011
Answered
by
janl
hamiltonsalazar
asked this question in
Q&A
-
I want to a db and i can do this on Windows:
And CouchDB responds: * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0) * Server auth using Basic with user 'anna' > POST /pruebaproyecto/_find HTTP/1.1 > Host: 127.0.0.1:5984 > Authorization: Basic YW5uYTpzZWNyZXQ= > User-Agent: curl/7.55.1 > Accept: application/json > Content-Type: application/json > Content-Length: 758 > * upload completely sent off: 758 out of 758 bytes < HTTP/1.1 200 OK < Cache-Control: must-revalidate < Content-Type: application/json < Date: Sun, 19 Jul 2020 01:08:42 GMT < Server: CouchDB/3.1.0 (Erlang OTP/20) < Transfer-Encoding: chunked < X-Couch-Request-ID: 70be698066 < X-CouchDB-Body-Time: 0 < {"docs":[ {"_id":"112","name":"Nicol├ís","secondName":"Carlos","lastName":"Medina","secondLastName":"Rojas","scores":[5,1,2,2,1,6]}, {"_id":"12","name":"Ava","secondName":"Adeline","lastName":"C├írdenas","secondLastName":"Restrepo","scores":[1,7,4,4,5,9,9,8]}, {"_id":"122","name":"Renata","secondName":"Charlotte","lastName":"Arias","secondLastName":"Ram├¡rez","scores":[9,0,5,9,7,8,8]}, {"_id":"123","name":"Mat├¡as","secondName":"Mat├¡as","lastName":"Jaramillo","secondLastName":"Restrepo","scores":[0,5,4,2,5,9,1,7]}, {"_id":"124","name":"Carlos","secondName":"Nicol├ís","lastName":"Arias","secondLastName":"Jim├®nez","scores":[9,0,4,8,4,6,3,0]}, {"_id":"128","name":"Adeline","secondName":"Evelyn","lastName":"Fl├│rez","secondLastName":"Gonz├ílez","scores":[9,1,7,3,2,9,7,2,7]}, {"_id":"130","name":"Amalia","secondName":"Amalia","lastName":"Rodr├¡guez","secondLastName":"Mar├¡n","scores":[7,2,1,7,0,4,9,2,7]}, {"_id":"138","name":"Adelaide","secondName":"Eleanor","lastName":"Arias","secondLastName":"Mej├¡a","scores":[7,9,8,5,4,9,9,5]}, {"_id":"142","name":"Adeline","secondName":"Regina","lastName":"Medina","secondLastName":"Medina","scores":[8,2,4,0,9,2,0,6]}, {"_id":"144","name":"Miguel","secondName":"Diego","lastName":"Salazar","secondLastName":"Vel├ísquez","scores":[5,3,3,8,4,6,9,6,8,0]}, {"_id":"147","name":"Valent├¡n","secondName":"Carlos","lastName":"C├írdenas","secondLastName":"P├®rez","scores":[1,9,3,8,3]}, {"_id":"151","name":"Isla","secondName":"Lucy","lastName":"Ram├¡rez","secondLastName":"Fl├│rez","scores":[6,8,1,3,5,2]}, {"_id":"157","name":"Pablo","secondName":"Mat├¡as","lastName":"Cardona","secondLastName":"G├│mez","scores":[1,4,9,2,7,9,2,7,0]}, {"_id":"158","name":"Julia","secondName":"Valeria","lastName":"Restrepo","secondLastName":"Jaramillo","scores":[8,4,6,5,1,5,5,9,6,5]}, {"_id":"166","name":"Pablo","secondName":"Benjam├¡n","lastName":"Castro","secondLastName":"D├¡az","scores":[5,0,0,5,8,2,4,1]}, {"_id":"176","name":"Gabriel","secondName":"Thiago","lastName":"Rojas","secondLastName":"Garc├¡a","scores":[4,7,2,8,9,3,0]}, {"_id":"180","name":"Ver├│nica","secondName":"Sof├¡a","lastName":"Mej├¡a","secondLastName":"Escobar","scores":[9,2,4,2,0]}, {"_id":"181","name":"Mart├¡n","secondName":"Sim├│n","lastName":"Valencia","secondLastName":"Mu├▒oz","scores":[1,9,6,4,0,3,5,4]}, {"_id":"182","name":"Ava","secondName":"Olivia","lastName":"Torres","secondLastName":"Rojas","scores":[9,5,9,9,5,0]}, {"_id":"189","name":"Valeria","secondName":"Evelyn","lastName":"Quintero","secondLastName":"C├írdenas","scores":[7,2,2,1,5,8]}, {"_id":"195","name":"Dante","secondName":"Diego","lastName":"P├®rez","secondLastName":"Rojas","scores":[8,9,4,1,7]}, {"_id":"201","name":"Dulce","secondName":"Alice","lastName":"Rojas","secondLastName":"Osorio","scores":[4,4,4,6,8,6,2,0,7]}, {"_id":"203","name":"Amalia","secondName":"Cora","lastName":"Zapata","secondLastName":"Romero","scores":[1,7,8,1,4,0,0,5]}, {"_id":"208","name":"├üngel","secondName":"Juli├ín","lastName":"Mu├▒oz","secondLastName":"Cardona","scores":[8,7,6,7,9,0,7,6]}, {"_id":"211","name":"Sergio","secondName":"Pablo","lastName":"Quintero","secondLastName":"Morales","scores":[3,0,6,1,8,7,0,0,1]} ], "bookmark": "g1AAAAA2eJzLYWBgYMpgSmHgKy5JLCrJTq2MT8lPzkzJBYozGxkagqQ4YFIwwSwAfeUN4w", "execution_stats": {"total_keys_examined":0,"total_docs_examined":0,"total_quorum_docs_examined":0,"results_returned":25,"execution_time_ms":219.0}, "warning": "No matching index found, create an index to optimize query time."} * Connection #0 to host 127.0.0.1 left intact But if i want to send the full word
And CouchDB responds with: * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0) * Server auth using Basic with user 'anna' > POST /pruebaproyecto/_find HTTP/1.1 > Host: 127.0.0.1:5984 > Authorization: Basic YW5uYTpzZWNyZXQ= > User-Agent: curl/7.55.1 > Accept: application/json > Content-Type: application/json > Content-Length: 760 > * upload completely sent off: 760 out of 760 bytes < HTTP/1.1 400 Bad Request < Cache-Control: must-revalidate < Content-Length: 54 < Content-Type: application/json < Date: Sun, 19 Jul 2020 01:18:41 GMT < Server: CouchDB/3.1.0 (Erlang OTP/20) < X-Couch-Request-ID: 8b440c8622 < X-CouchDB-Body-Time: 0 < {"error":"bad_request","reason":"invalid UTF-8 JSON"} * Connection #0 to host 127.0.0.1 left intact |
Beta Was this translation helpful? Give feedback.
Answered by
janl
Jul 20, 2020
Replies: 2 comments 4 replies
-
Does -H "Content-Type: application/json; charset=utf-8" solve the problem? |
Beta Was this translation helpful? Give feedback.
2 replies
-
try saving the POST data in a file and use |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
janl
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try saving the POST data in a file and use
--data-binary @filename.json
instead of-d …
. That then rules out any terminal/shell encoding issues.