[Patch]: Unicode length
Wed Jun 16 12:37:00 GMT 2004
On Jun 16 07:28, Pierre A. Humblet wrote:
> At 09:29 AM 6/16/2004 +0200, Corinna Vinschen wrote:
> >This change looks not quite ok. The return value from MultiByteToWideChar
> >is the "number of wide characters" while Length and MaximumLength in a
> >UNICODE_STRING are defined to contain "the length in bytes".
> Right, that's why the return value is multiplied by sizeof (WCHAR), as in
> + tgt.MaximumLength = sys_mbstowcs (buf, srcstr, strlen (srcstr) + 1) * sizeof (WCHAR);
I missed the `* sizeof (WCHAR)' part, sorry. Please check it in if
you think it's fine.
> After sleeping over it I see other issues. An accented string can have several
> unicode representations, e.g. with composite characters or with precomposed
> characters. Do you know if NT prefers or insists on one or the other for filenames?
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Co-Project Leader mailto:firstname.lastname@example.org
Red Hat, Inc.
More information about the Cygwin-patches