It's no wonder there are so many encoding questions when the various methods of
getting incoming data produce different results. This is one area OP really
needs to focus on - all of them should produce the same results.
Below is an example of how Client_PostParams mangles utf8 parameters
from multipart forms.
Client_PostParams returns data in something that could've been
ISO-8859-1, but isn't. 'ä' has been decoded to 0x8a, 'ö' to 0x9a and 'å'
to 0x8c. (Correct ISO-8859-1 would've been 0xe4, 0xf6 and 0xe5).
Client_PostArgs work as expected though.
-- From LDML
[Client_PostArgs] returns a string containing all the arguments passed
by a form for the current request. Individual parameters are name/value
pairs with an equals sign, separated by ampersands.
The [Client_PostParams] tag returns the same information pre-parsed into
a pair array.
----------- libcurl example with utf8 data -------------
// Convert wide string data to UTF-8 (Win32 API)
// (Dont ask me how it knows what charset our input data is
// in - just accept the fact that it works ;)
r = WideCharToMultiByte(CP_UTF8, 0, blah, -1, str, 128*1024,
curl_formadd(&post, &last, CURLFORM_PTRNAME, "utf8",
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_write_func);
curl_res = curl_easy_perform(curl);