View previous topic :: View next topic |
Author |
Message |
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Sun Dec 20, 2009 7:32 am Post subject: void* to string? |
|
|
I'm trying to get the URI-s of files I've selected in FileChooserDialog. I got the ListG and used function ListG.nthData().
And now I've got void*. How to convert it into D string? |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Sun Dec 20, 2009 9:50 am Post subject: |
|
|
cast is to a char* and use toString. there is a toString in glib.Str.
toString( cast(char*)myvar ) |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Sun Dec 20, 2009 12:08 pm Post subject: |
|
|
Thanks a lot, works |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Tue Dec 22, 2009 4:07 am Post subject: |
|
|
Well, another problem has come up.
After such a conversions spaces are replaced with %20 and some chars unavailable in english language are replest with %XX%XX (where X is a hex digit). Is there any way to avoid it or I just have to use the replace() method? |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Tue Dec 22, 2009 6:59 am Post subject: |
|
|
The strings might be URI encoded. that would be a reason why some chars are %XX.
there is glib.URI.unescapeString() if you need the unescaped string. |
|
Back to top |
|
|
|