-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[win32] CharsetConverter: Fix: allow to use correctly UTF-32 on windows #3342
Conversation
Seems to be a bug (wrong compiler configuration) in our supplied libiconv
jenkins build this please |
What are you trying to fix here? i.e. what is UTF-32 giving you on win32 that you don't think is right? |
Conversion to UTF-32 with current lib give the same result as UTF-32BE. This is wrong as it should be UTF-32LE. Think this is a main reason why all those defs are here - fix wrong endianness on Win32. Fortunately UTF-8 is endianness agnostic so we don't have much troubles until now (except "UTF-16"). |
That seems most strange to me. Can you see from the iconv sources why this might be? |
I'll check it. |
As soon as I replace UTF-16LE with UTF-16 in define everything goes wrong. |
Surprise! This is intentional. At least for GNU's libiconv /* We output UTF-16 in big-endian order, with byte-order mark.
See RFC 2781 section 3.3 for a rationale: Some document formats
mandate a BOM; the file concatenation issue is not so severe as
long as the above utf16_mbtowc function is used. */ and /* We output UTF-32 in big-endian order, with byte-order mark. */ 'BE' and 'LE' versions don't output BOM So this fix is valid. But I need to check other iconv implementation. Looks like for wide string it's better to use WCHAR_T as it doesn't have UTF-32 limitations and doesn't have surrogate pairs on Win32. If other implementations is similar, I'll publish another PR with WCHAR_T fix. |
Whats wrong with it? Please elaborate and correct it. |
@wsoltys Missing steps in readme.txt
|
I won't say that I did it right but why do you want to run mingw configure and compile it afterwards with vs? Does it provide another iconv header or for what is it good? |
@wsoltys "configure" generates real '.h' files from '.h.in', vs2010 project unable to do so. Generated headers can be put into package, to allow simple compilation with vs project. Need to put it to 'lib/win32' (or any other folder in XBMC tree in form 'foo1/bar2') for compilation as libiconv_win32.vcxproj has |
That might be a leftover from when it was in tree. Fix it, compile it off tree and make it a dep. I don't think that it depends on anything in our tree so the props might not be needed (but could be wrong as it's some time ago ;)
|
Better solution: #3353 |
Seems to be a bug (wrong compiler configuration) in our supplied libiconv
This PR will not break anything as the only "old" utf32ToStringCharset function was unused.