www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6130] New: utf.toUTF16z needs to be callable with any string type

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6130

           Summary: utf.toUTF16z needs to be callable with any string type
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-06-08
17:54:51 PDT ---
Currently only passing UTF8 strings works. wstrings should be supported too:

wstring a = "foo";
toUTF16z(a);

testwstring.d(12): Error: function std.utf.toUTF16z (in const(char[]) s) is not
callable using argument types (immutable(wchar)[])
testwstring.d(12): Error: cannot implicitly convert expression (a) of type
immutable(wchar)[] to const(char[])

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6130



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-06-13
08:36:24 PDT ---
Also, dstrings should be supported. It makes it much easier to deal with the
windows api when you have access to the count of code points of a string:

dstring text = "ABCDE abcde  ";
TextOut(hdc, 0, 0, text.toUTF16z, text.length);

That won't compile and I have to do this instead:
TextOut(hdc, 0, 0, to!string(text).toUTF16z, text.length);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 13 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6130


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-10-26
08:46:36 PDT ---
I think this is safe to close since we now have toUTFz.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 26 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6130


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com


--- Comment #3 from Jonathan M Davis <jmdavisProg gmx.com> 2011-10-26 09:35:51
PDT ---
https://github.com/D-Programming-Language/phobos/pull/279 will actually do
this, since it'll make to so that toUTF16z just calls toUTFz internally, in
which case it's easy to make toUTF16z take any string type.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 26 2011