The encdec interface I described can convert non-null terminated strings by limiting the number of bytes inspected in src using the sn parameter.
The iconv interface is still cleaner. I do admit though, I would also like lower-level access to the iconv internal structures. Until we've eliminated all vestiges of the various non-unicode encodings, being able to replace iconvs main loop could be very handy.
The W3C claims all apps should use UTF-16 internally
Ghastly recommendation. I'd sooner see utf-16 deprecated as a unicode encoding than advise it be used anywhere where its not strictly mandatory for *backwards* compatibility.
Do you have a link to this malfeasance? Perhaps Im using the wrong search keys...
The CIFS networking protocol will negotiate the
character encoding as either UCS-2LE (which is sometimes really UTF16-LE)
or the locale 8 bit codepage.
Then it should be no problem. You should easily be able to strlen or wcslen both of those types of string. Certainly you will be able to discover which was negotiated, since you have to pass the encoding to iconv to convert, right?
-- Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/
