digitalmars.D.learn - Changing to UTF-8
- jicman (8/8) Mar 24 2005 Greetings!
- Ben Hinkle (5/7) Mar 24 2005 There are two options:
- Manfred Hansen (5/13) Mar 25 2005 I have try to collect some links in a database.
- J C Calvarese (14/30) Mar 25 2005 I think I found the iconv binding:
- Manfred Hansen (9/47) Mar 26 2005 The idea came in my mind from Ruby Application Archive.
- Regan Heath (9/18) Mar 25 2005 Step 1, don't use char[] to store non UTF-8 data. Use byte[]. eg.
Greetings! Ok folks, I am sorry, but I have not been able to get UTF-8 to work. So, let us imagine that I have a subrouting that returns a bunch of XML that is non-UTF-8 to a string, char[] str = GetNonUTF8Data(); How do I change str to UTF-8 data? Any help would be greatly appreciate it. thanks. jic
Mar 24 2005
How do I change str to UTF-8 data? Any help would be greatly appreciate it.There are two options: 1) the ICU binding in mango http://dsource.org/projects/mango/ 2) the iconv binding that I can't seem to find anywhere but I remember seeing... anyone know where the iconv binding is? (ps - I wish we had an updated community links/libs page...)
Mar 24 2005
Ben Hinkle wrote:I have try to collect some links in a database. http://www.steinmole.de/d_lib You can search for iconv. ManfredHow do I change str to UTF-8 data? Any help would be greatly appreciate it.There are two options: 1) the ICU binding in mango http://dsource.org/projects/mango/ 2) the iconv binding that I can't seem to find anywhere but I remember seeing... anyone know where the iconv binding is? (ps - I wish we had an updated community links/libs page...)
Mar 25 2005
Manfred Hansen wrote:Ben Hinkle wrote:I think I found the iconv binding: http://www.algonet.se/~afb/d/libiconv.d (from http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/17913) And a related thread that seemed to devolve into licensing issues: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/13095How do I change str to UTF-8 data? Any help would be greatly appreciate it.There are two options: 1) the ICU binding in mango http://dsource.org/projects/mango/ 2) the iconv binding that I can't seem to find anywhere but I remember seeing... anyone know where the iconv binding is? (ps - I wish we had an updated community links/libs page...)I have try to collect some links in a database. http://www.steinmole.de/d_libCool idea.You can search for iconv. ManfredI think you meant this: http://www.steinmole.de/d_lib/start.cgi Looks good. I hope you don't mind that I added it to http://www.prowiki.org/wiki4d/wiki.cgi?MoreLinks -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Mar 25 2005
J C Calvarese wrote:Manfred Hansen wrote:The idea came in my mind from Ruby Application Archive. http://raa.ruby-lang.org/ During insert the links in the database, i was surprised how many libraries and tools there are for D.Ben Hinkle wrote:I think I found the iconv binding: http://www.algonet.se/~afb/d/libiconv.d (from http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/17913) And a related thread that seemed to devolve into licensing issues: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/13095How do I change str to UTF-8 data? Any help would be greatly appreciate it.There are two options: 1) the ICU binding in mango http://dsource.org/projects/mango/ 2) the iconv binding that I can't seem to find anywhere but I remember seeing... anyone know where the iconv binding is? (ps - I wish we had an updated community links/libs page...)I have try to collect some links in a database. http://www.steinmole.de/d_libCool idea.Yes that is OK.You can search for iconv. ManfredI think you meant this: http://www.steinmole.de/d_lib/start.cgiLooks good.The most work was to deal with the special character å, ö and so on.I hope you don't mind that I added it to http://www.prowiki.org/wiki4d/wiki.cgi?MoreLinksNo problem. Manfred
Mar 26 2005
On Fri, 25 Mar 2005 03:56:03 +0000 (UTC), jicman <jicman_member pathlink.com> wrote:Greetings! Ok folks, I am sorry, but I have not been able to get UTF-8 to work. So, let us imagine that I have a subrouting that returns a bunch of XML that is non-UTF-8 to a string, char[] str = GetNonUTF8Data();Step 1, don't use char[] to store non UTF-8 data. Use byte[]. eg. byte[] raw = GetNonUTF8Data();How do I change str to UTF-8 data? Any help would be greatly appreciate it.Step 2, find/write a routine to convert from your encoding X into UTF-8 and call it. Ben has suggested some libraries that will do it. Alternately, depending on X, it might be easy/possible to write a routine yourself. Regan
Mar 25 2005