[Mono-bugs] [Bug 464128] New: char* should be in ANSI encoding when passed to C runtime rather than Unicode

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 7 08:54:23 EST 2009


           Summary: char* should be in ANSI encoding when passed to C
                    runtime rather than Unicode
           Product: Mono: Runtime
           Version: unspecified
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: kornelpal at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Linux implements Unicode support using UTF-8 that uses char*. C runtime
function are thus safe to be called with internal char* representations.

Windows on the other hand implements Unicode support using UTF-16 using
wchar_t* and provides support for ANSI code pages using char*.

The ANSI code page is a system-wide non-Unicode code page.

This is major issue on Windows because this can result in unexpected esoteric
bugs that are hart to track using non-English characters in file names for

As a result we should avoid using C runtime library calls that result in
operating system calls. (String manipulation without is fine though.)

GLib on the other hand properly implements UTF-8 to UTF-16 conversion and avoid
this problem.

This is also a security issue because file names can be improperly represented.

The solution is to either use GLib functions for these C runtime calls or use
the Unicode versions on Windows.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list