D - D in the future
- "Tóth László" <laslie_toth hotmail.com> Sep 14 2006
- Chris Nicholson-Sauls <ibisbasenji gmail.com> Sep 14 2006
- Hasan Aljudy <hasan.aljudy gmail.com> Oct 02 2006
- Boyko Bantchev <boykobb gmail.com> Oct 04 2006
- Josh Stern <josh_usenet phadd.net> Oct 04 2006
- Josh Stern <josh_usenet phadd.net> Oct 04 2006
- Boyko Bantchev <boykobb gmail.com> Oct 04 2006
D is dead? I found D language from C::B IDE, but the D pages are too old in the internet.
Sep 14 2006
Tóth László wrote:D is dead? I found D language from C::B IDE, but the D pages are too old in the internet.
Too old?? The front page is from less than a month ago... The latest entry in the change log is from just two weeks ago... No no, we are quite alive and kicking. Except that this newsgroup ('D') was long ago abandoned. All discussions are in the 'digitalmars.D[.*]' family. Listing available here: http://www.digitalmars.com/NewsGroup.html -- Chris Nicholson-Sauls
Sep 14 2006
no, check the change log, and, get a newsreader client and checkout the Digitalmars.D newsgroup .. not this one, because it's um .. how do you say it? deprecated.
Oct 02 2006
Hello! I need to read & write text files in cyrillic encoding, cp1251, on Windows. How can I do that? Are there library functions that could transform strings between specific, byte-for-byte encodings, such as cp1251, and utf-8? I tried to find such in Phobos, but couldn't. Thanks, Boyko
Oct 04 2006
On Wed, 04 Oct 2006 13:00:51 +0000, Boyko Bantchev wrote:Hello! I need to read & write text files in cyrillic encoding, cp1251, on Windows. How can I do that? Are there library functions that could transform strings between specific, byte-for-byte encodings, such as cp1251, and utf-8? I tried to find such in Phobos, but couldn't. Thanks,
Use this web page in your application after swapping the comment token in your edit: http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT Then D has std libs to concast unsigned 32 bit unicode values to utf8 byte string reps (e.g. look in std.utf8) The utf8 encoding is explained here (simple enough to write your own function if you wanted to): http://www.cl.cam.ac.uk/~mgk25/unicode.html
Oct 04 2006
I should add that D also has the import std.c.wcharh and the C function mbsrtowcs() and related may already do what you want for the first part of the mapping (cyrillic encoding to unicode). On Wed, 04 Oct 2006 12:58:44 -0500, Josh Stern wrote:On Wed, 04 Oct 2006 13:00:51 +0000, Boyko Bantchev wrote:Hello! I need to read & write text files in cyrillic encoding, cp1251, on Windows. How can I do that? Are there library functions that could transform strings between specific, byte-for-byte encodings, such as cp1251, and utf-8? I tried to find such in Phobos, but couldn't. Thanks,
Use this web page in your application after swapping the comment token in your edit: http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT Then D has std libs to concast unsigned 32 bit unicode values to utf8 byte string reps (e.g. look in std.utf8) The utf8 encoding is explained here (simple enough to write your own function if you wanted to): http://www.cl.cam.ac.uk/~mgk25/unicode.html
Oct 04 2006
Thanks, Josh!
I've found the following to work for me:
1) read through getchar(), write through putchar()
(wrapping each one in to work at string/line level) --
so the cp1251-encoded text goes in and out untouched;
2) to transform constant cyrillic strings (which in the program
source are utf-8) for output in cp1251, I use the following
(which must be slightly modified if the strings are mixed
cyrillic/latin):
char[] UTF8to1251(char[] s) {
int n = s.length;
char[] d;
for (uint i=0; i<n;)
d ~= decode(s,i)-(1040-192);
return d;
}
Oct 04 2006









Chris Nicholson-Sauls <ibisbasenji gmail.com> 