cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl --data-urlencode posts broken non-English characters

From: Irvin Jacob <nivribocaj_at_gmail.com>
Date: Mon, 1 Feb 2016 23:18:37 +0800

I am using curl to reply to a topic in a vBulletin forum from a text file.

My command looks like this:

curl -b "cookies.txt" -d "title=" --data-urlencode
"message_backup_at_message.txt" --data-urlencode "message_at_message.txt" -d
"wysiwyg=0" -d "iconid=0" -d "s=" ... "
http://somesite.com/newreply.php?do=postreply&t=something" -L

Note that I just wrote "..." above because the command is too long.

message.txt has Japanese text "*大日本帝國*" inside and it is encoded in UTF-8.
Curl successfully posted the message but the Japanese characters turned
into "*大日本å¸åœ‹*" in my message posted on the forum. Other normal
(ASCII) characters look fine though. I also tried other foreign characters
like Greek letters and accented letters. "*Thére Àre sôme spëcial
charâcters ïn thìs têxt*" became "*Thére Àre sôme spëcial charâcters
ïn thìs têxt*"

I tried specifying the header Content-Type:
application/x-www-form-urlencoded; charset=UTF-8 via -H option. I tried
adding --compressed and --tr-encoding options. I also tried different
versions of curl. All of these did not change anything.

Could somebody please help me?

-- 
*Irvin*
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
This
email has been sent from a virus-free computer protected by Avast.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2016-02-01