fix unicode input
This commit is contained in:
parent
86ed10917d
commit
0d397c20ed
|
@ -28,6 +28,7 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
@ -370,6 +371,12 @@ bool justify(const Settings& settings)
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
// Set locale to make unicode input work properly.
|
||||
const char* langEnv = std::getenv("LANG");
|
||||
const std::string sysLocale{langEnv ? langEnv : "en_US.utf8"};
|
||||
std::locale::global(std::locale(sysLocale));
|
||||
|
||||
std::vector<std::string> arguments(argv, argv + argc);
|
||||
Settings settings = parseArgs(arguments);
|
||||
if (settings.error) return 1;
|
||||
|
|
Loading…
Reference in New Issue