Re: readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread Andre Pany via Digitalmars-d-learn

On Tuesday, 17 October 2017 at 15:02:29 UTC, Adam D. Ruppe wrote:
Or try this newest commit 
https://github.com/adamdruppe/arsd/blob/master/terminal.d and 
see if it works better for you.


Thank you Adam. The ascii thing was causing the issue in the 
windows console.

Now it is working fine.

Kind regards
André


Re: readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread user1234 via Digitalmars-d-learn

On Tuesday, 17 October 2017 at 15:02:29 UTC, Adam D. Ruppe wrote:
Or try this newest commit 
https://github.com/adamdruppe/arsd/blob/master/terminal.d and 
see if it works better for you.


in the commit message: ~~ascii~~ ANSI.


Re: readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread notna via Digitalmars-d-learn

On Tuesday, 17 October 2017 at 15:02:29 UTC, Adam D. Ruppe wrote:
Or try this newest commit 
https://github.com/adamdruppe/arsd/blob/master/terminal.d and 
see if it works better for you.


- Here is what I use in one of my tools... and I never had 
problems with German password so far ;)


string getPassword(char mask = '*')
{
import std.stdio;
import libs.terminal;
auto term = Terminal(ConsoleOutputType.linear);
auto input = RealTimeConsoleInput(, ConsoleInputFlags.raw);
string pass;
dchar ch;
ch = input.getch();
while(ch != '\r' && ch != '\n')
{
import std.range;
if(ch == '\b' && !pass.empty)
{
pass = pass[0..$-1];
write('\b');
stdout.flush;
}
else
{
pass ~= ch;
write(mask);
stdout.flush();
}
ch = input.getch();
}
return pass;
}


Re: readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread Adam D. Ruppe via Digitalmars-d-learn
Or try this newest commit 
https://github.com/adamdruppe/arsd/blob/master/terminal.d and see 
if it works better for you.


Re: readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread Adam D. Ruppe via Digitalmars-d-learn

On Tuesday, 17 October 2017 at 12:08:57 UTC, Andre Pany wrote:
I want to read passwords from the console (should be work on 
windows / linux / macos).


Do you have a little test program I can copy/paste?

I suspect this is because I called ReadConsoleInputA instead of W 
for some weird reson..


readln of german Umlaute (terminal.d) / readln)

2017-10-17 Thread Andre Pany via Digitalmars-d-learn

Hi,

I want to read passwords from the console (should be work on 
windows / linux / macos).
Adam Ruppe has a quite nice library (terminal.d) which allows to 
deactivating the echo to the console, which makes sense for 
passwords.


But I do not get it working with terminal.d nor with std.stdio: 
readln if it comes to special characters like ö.


The password is saved to a file.
readln will save for "ööö": "x94x94x94\n"
terminal.d will save: CCHCCHCCH

Changing the code page (CHCP 65001) will lead to the effect that 
empty strings are saved for both (readln, terminal.d)


Does someone already solved this problem and has a solution 
working on all operation systems?


Kind regadrs
André