summaryrefslogtreecommitdiffstats
path: root/src/madc.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-27 23:51:34 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-27 23:51:34 +0200
commita7a285eb61dd83afc892bc1d64ffe14b9f1426a3 (patch)
tree08d2efcaec46e5f5702d9e336a0e8ba7e636aff9 /src/madc.cpp
parentb40ba0cf91603b695f1f2380cbd39966a458f22f (diff)
downloadmad-a7a285eb61dd83afc892bc1d64ffe14b9f1426a3.tar
mad-a7a285eb61dd83afc892bc1d64ffe14b9f1426a3.zip
Completely migrate to Unicode String class
Diffstat (limited to 'src/madc.cpp')
-rw-r--r--src/madc.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/madc.cpp b/src/madc.cpp
index 88060e9..7d8cb81 100644
--- a/src/madc.cpp
+++ b/src/madc.cpp
@@ -95,21 +95,18 @@ int main(int argc, char *argv[]) {
std::cerr << " connected." << std::endl << std::endl;
{
- std::string username;
- Core::String password;
-
std::cerr << "Login: " << std::flush;
- std::getline(std::cin, username);
- password = Client::PasswordReader::readPassword("Password: ");
+ Core::String username = Core::String::getline(std::cin);
+ Core::String password = Client::PasswordReader::readPassword("Password: ");
try {
- Client::Authenticators::ChallengeResponseAuthenticator::authenticate(&application, connection, username.c_str(), password);
+ Client::Authenticators::ChallengeResponseAuthenticator::authenticate(&application, connection, username, password);
}
catch(Core::Exception e) {
if(e.getErrorCode() != Core::Exception::NOT_AVAILABLE)
throw e;
- Client::Authenticators::PasswordAuthenticator::authenticate(&application, connection, username.c_str(), password);
+ Client::Authenticators::PasswordAuthenticator::authenticate(&application, connection, username, password);
}
}
@@ -144,8 +141,7 @@ int main(int argc, char *argv[]) {
commandParser.requestDisconnect();
}
else if(*cmd) {
- // TODO Use locale
- commandParser.parse(Core::String::fromUTF8(cmd));
+ commandParser.parse(Core::String::fromLocale(cmd));
history(hist, &histEv, H_ENTER, cmd);
}
else continue;