Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #338 (closed wishlist: fixed)

Opened 1 year ago

Last modified 1 year ago

Please add toUtf16z and fromUtf16z to tango.stdc.stringz

Reported by: maxter Assigned to: kris
Priority: minor Milestone: 0.97 RC 1
Component: Tango Version: trunk
Keywords: Cc:

Description

Useful for interoperatng with W functions of Win32 API.

version (Win32SansUnicode)
{
}
else version (Windows)
{
  wchar* toUtf16z(wchar[] str)
  {
    return str is null ? null : (str ~ "\0").ptr;    
  }
  wchar[] fromUtf16z(wchar* zStr)
  {
    if (zStr is null)
      return null;

    size_t i;
    while(zStr[i] != 0)
      i++;
    return zStr[0..i]; 
  }
}

Change History

03/17/07 15:51:00 changed by kris

  • status changed from new to closed.
  • version set to trunk.
  • resolution set to fixed.
  • milestone set to 0.97 RC 1.

Good idea ... added to tango.stdc.stringz

03/19/07 07:08:40 changed by maxter

Thanks