www.digitalmars.com         C & C++   DMDScript  

D - I use wstring in my terminal and see what happened.

reply "Cassio Butrico" <cassio_butrico ig.com.br> writes:
Anyone help me?

I am using the version for the windows dmd v 2.066
to last I believe.

tried to use wstring in my terminal and see what happened.

     wstring name;
     write("wstring - write a name: ");
     //readf("%s\n", &name);
     name =  cast(wstring)chomp(readln());
     //name =  to!wstring(chomp(readln()));// with accent runtime 
error utf
     writeln("name  length - ",name.length," - ",name);
     string namec = cast(string)name;//
    // string namec = to!string(name);
     writeln("namec length - ",namec.length," - ", namec);
     writeln("you write: ",namec," ok.");

    wstring - write a name: cassio
    name  length - 3 - µàúþì│µ¢®
    namec length - 6 - cassio
    you write: cassio ok.

or this

     wstring name;
     write("wstring - write a name: ");
     readf("%s\n", &name);
     //name =  cast(wstring)chomp(readln());
     //name =  to!wstring(chomp(readln()));// with accent runtime 
error utf
     writeln("name  length - ",name.length," - ",name);
     string namec = cast(string)name;//
    // string namec = to!string(name);
     writeln("namec length - ",namec.length," - ", namec);
     writeln("you write: ",namec," ok.");


    wstring - write a name: cassio
    name  length - 6 - cassio
    namec length - 12 - c a s s i o
    you write: c a s s i o  ok.

tried to use wstring in my terminal and see what happened.
very strange do not you think?
I tried several times changing conversions to cast. to! ...
question what I'm doing wrong?

sorry English is not my official language.

aguem  pode me ajudar?
estou usando a versão para win do dmd v 2.066 a ultima creio eu.
tentei usar  wstring no meu terminal e veja o que aconteceu.
muito estranho não acha?
tentei varias vezes mudando as conversões de cast para . to! ...
pergunta  o que estou fazendo de errado?
desculpe-me  ingles não e minha lingua oficial.
Aug 26 2014
parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
This forum/news group is retired, almost nobody reads it any more.

It's better to post your message to digitalmars.D.learn, which is 
very active:
http://forum.dlang.org/group/digitalmars.D.learn

You should receive a response there quickly.
Aug 28 2014
parent "Cassio Butrico" <cassio_butrico ig.com.br> writes:
On Thursday, 28 August 2014 at 19:31:47 UTC, Marc Schütz wrote:
 This forum/news group is retired, almost nobody reads it any 
 more.

 It's better to post your message to digitalmars.D.learn, which 
 is very active:
 http://forum.dlang.org/group/digitalmars.D.learn

 You should receive a response there quickly.
Thank you for your attention. I'll check;
Aug 28 2014