[Mono-devel-list] filename character conversions (util/strenc.c)

Dick Porter dick at ximian.com
Tue Nov 4 08:22:42 EST 2003


On Tue, 2003-11-04 at 01:58, Bernie Solomon wrote:
> I have a couple of questions about strenc.c as it isn't currently working
> for me e.g. GetCurrentDirectory fails. I don't have libiconv at the moment
> though clearly could grab it.

glib should include iconv if your platform doesn't have it, I thought.

> Why does it explicitly translate to UTF16LE and not the host's endianness?
> If I use g_utf8_to_utf16 and not g_convert it appears to work better to
> me on HP (at least GetCurrentDirectory does).

UTF16 is what the CLR specifies for "Unicode", and as the MS runtime
always seems to use LE (whether because it's x86-platform-endian or by
choice) it makes sense to always use LE in mono.  (Page 141 of my copy
of Partition II mentions x86-endian storage for enum array elements of
fixed args that are not bool or char.  It doesn't seem to specify the
endianness of unicode chars anywhere.)

> Also it seems a bit odd to have both ICU (which I do have at present) and
> ICONV about both of which can do the same thing. It would be nice if we
> could use only one (ICU of course is my preference). Though since
> I won't be using different filename encodings at the moment that is
> not that relevant.

I could have used ICU, but that would have made it a strict dependency
not an optional one.  As glib is already a strict dependency I chose to
use that one.  I suppose strenc.c could check for ICU and use that if
possible.

- Dick





More information about the Mono-devel-list mailing list