• Vladislav Vaintroub's avatar
    MDEV-27089 Windows : incorrect handling of non-ASCIIs in get_tty_password · 9e9b211f
    Vladislav Vaintroub authored
    Prior to patch, get_password would echo multple mask characters '*', for
    a single multibyte input character.
    
    Fixed the behavior by using "wide" version of getch, _getwch.
    Also take care of possible characters outside of BMP (i.e we do not print
    '*' for high surrogates).
    
    The function will now internally construct the "wide" password string,
    and conver to the console codepage. Some characters could still be lost
    in that conversion, unless the codepage is utf8, but this is not any new
    bug.
    9e9b211f
get_password.c 5.37 KB