This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: Unicode length


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?

Precomposed, AFAIK.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]