Libiconv and errno (Win32)

php.internals

l0t3k

23 years ago
im developing an extension under Win32 which links to libiconv, but i'm having a slight problem. i have a conversion which fails (iconv returns (size_t)-1), but errno is set to 0. any clues as to what is happening ? not that it matters, but the conversion is from ISO-8859-1 to UTF-16 . l0t3k

Moriyoshi Koizumi

23 years ago
Hi, "l0t3k" <cshmoove@bellsouth.net> wrote:
> im developing an extension under Win32 which links to libiconv, but i'm > having a slight problem. i have a conversion which fails (iconv returns > (size_t)-1), but errno is set to 0. > any clues as to what is happening ? > > not that it matters, but the conversion is from ISO-8859-1 to UTF-16 .
That's most likely iconv.dll and your extension are linked to different libc dlls since errno variable is both dll specific and thread specific. It also fails to set a correct value to errno if your iconv.dll is statically linked to MS libc. Moriyoshi

l0t3k

23 years ago
thanks for the quick response. i guess i have some digging to do. by the way, how far along is the new mbstring ? libiconv is not too convenient or smart on chunked conversions (which is where my problem lies) my last look a mbstring made me believe that this is something you consciously address. since my extension is ZE2 specific, i have some time to play with. l0t3k "Moriyoshi Koizumi" <moriyoshi@at.wakwak.com> wrote in message news:20030518101203WUqOgo@at.wakwak.com...

Moriyoshi Koizumi

23 years ago
"l0t3k" <cshmoove@bellsouth.net> wrote:
> thanks for the quick response. i guess i have some digging to do. by the > way, how far along is the new mbstring ? libiconv is not too convenient or > smart on chunked conversions (which is where my problem lies) my last look a > mbstring made me believe that this is something you consciously address. > since my extension is ZE2 specific, i have some time to play with.
Well, so far I didn't make significant progress in that, unfortunately. I'm still stuck with the API design as I'm still looking for a reasonable settlement between per-character-basis and per-octet-basis. BTW I've got no such idea that iconv is less convenient for chunked conversion. IMO some thin wrapper on the library could help as well as you want. Moriyoshi

l0t3k

23 years ago
thanks for the quick response. i guess i have some digging to do. by the way, how far along is the new mbstring ? libiconv is not too convenient or smart on chunked conversions (which is where my problem lies) my last look a mbstring made me believe that this is something you consciously address. since my extension is ZE2 specific, i have some time to play with. l0t3k "Moriyoshi Koizumi" <moriyoshi@at.wakwak.com> wrote in message news:20030518101203WUqOgo@at.wakwak.com...