i wrote a php script which recieves http POST packages from a windows-client-software.
the windows client uses the "WinHttpClient" for C++.
the WinHttpClient takes the messages i send as wchar_t.
the problem now is, i recieve the messages on my PHP file, but some signs like the "®" sign are shown as "®".
as far as i know, i cannot change the charset of my client to utf-8 or something like that. but maybe some people here know how to "convert" the wide-chars to an utf8 with which PHP can work fine. Because i have to persist the data into an Database which runs only with utf-8.
I tried it with the following, but it doesnt change it :(
function ewchar_to_utf8($matches) {
$ewchar = $matches[1];
$binwchar = hexdec($ewchar);
$wchar = chr(($binwchar >> 8) & 0xFF) . chr(($binwchar) & 0xFF);
return iconv("unicodebig", "utf-8", $wchar);
}
function special_unicode_to_utf8($str) {
return preg_replace_callback("/\\\u([[:xdigit:]]{4})/i", "ewchar_to_utf8", $str);
}
maybe you got some ideas :) Thanks