digitalmars.D.learn - String conversion functions in Phobos
- simendsjo (7/7) Aug 02 2011 I want to convert SomeChar[] or SomeChar* into
- Jonathan M Davis (4/13) Aug 02 2011 The github version has std.utf.toUTFz, but it obviously won't be in an a...
- simendsjo (3/4) Aug 02 2011 Thanks, I'll try that.
- Jonathan M Davis (5/10) Aug 02 2011 I believe that it'll work with char* to string with std.conv.to, but I t...
- simendsjo (4/14) Aug 02 2011 toUTFz worked great. It's good to see how phobos are just
- Jonathan M Davis (7/25) Aug 02 2011 Maybe. Hopefully. It's on the todo list. I don't know when it'll get don...
I want to convert SomeChar[] or SomeChar* into PerhapsAnotherCharNullTerminated*, but std.conv doesn't work like this. char[] a = "ao"; to!(wchar*)(a); // fails toUTF16z converts char[] to wchar* toStringz converts char[] to char* Am I missing function(s), or do I have to combine them myself?
Aug 02 2011
On Tuesday 02 August 2011 12:02:07 simendsjo wrote:I want to convert SomeChar[] or SomeChar* into PerhapsAnotherCharNullTerminated*, but std.conv doesn't work like this. char[] a = "ao"; to!(wchar*)(a); // fails toUTF16z converts char[] to wchar* toStringz converts char[] to char* Am I missing function(s), or do I have to combine them myself?The github version has std.utf.toUTFz, but it obviously won't be in an actual release until the next release. - Jonathan M Davis
Aug 02 2011
On 02.08.2011 12:07, Jonathan M Davis wrote:The github version has std.utf.toUTFzThanks, I'll try that. What about the other way around? * to []?
Aug 02 2011
On Tuesday 02 August 2011 12:15:00 simendsjo wrote:On 02.08.2011 12:07, Jonathan M Davis wrote:I believe that it'll work with char* to string with std.conv.to, but I think that's it at the moment. Ideally, std.conv.to would do the conversions in both directions for all string types, but it doesn't do that yet. - Jonathan M DavisThe github version has std.utf.toUTFzThanks, I'll try that. What about the other way around? * to []?
Aug 02 2011
On 02.08.2011 12:27, Jonathan M Davis wrote:On Tuesday 02 August 2011 12:15:00 simendsjo wrote:toUTFz worked great. It's good to see how phobos are just doing-the-right-thing most of the time. Are * to [] planned for the next release?On 02.08.2011 12:07, Jonathan M Davis wrote:I believe that it'll work with char* to string with std.conv.to, but I think that's it at the moment. Ideally, std.conv.to would do the conversions in both directions for all string types, but it doesn't do that yet. - Jonathan M DavisThe github version has std.utf.toUTFzThanks, I'll try that. What about the other way around? * to []?
Aug 02 2011
On Tuesday 02 August 2011 13:46:54 simendsjo wrote:On 02.08.2011 12:27, Jonathan M Davis wrote:Maybe. Hopefully. It's on the todo list. I don't know when it'll get done. It's on my todo list assuming that no one else gets to it first, but depending on when the next release is and how fast I am at getting to it (and how hard it is to implement - I ran into serious issues the last time that I tried to mess with std.conv.to), it may or may not be in by the next release. - Jonathan M DavisOn Tuesday 02 August 2011 12:15:00 simendsjo wrote:toUTFz worked great. It's good to see how phobos are just doing-the-right-thing most of the time. Are * to [] planned for the next release?On 02.08.2011 12:07, Jonathan M Davis wrote:I believe that it'll work with char* to string with std.conv.to, but I think that's it at the moment. Ideally, std.conv.to would do the conversions in both directions for all string types, but it doesn't do that yet. - Jonathan M DavisThe github version has std.utf.toUTFzThanks, I'll try that. What about the other way around? * to []?
Aug 02 2011