Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a non-unicode language environment, the time output from the command line is garbled #2343

Open
XinRoom opened this issue Aug 3, 2021 · 1 comment

Comments

@XinRoom
Copy link

XinRoom commented Aug 3, 2021

In my language environment (Windows locale Chinese) , the time of command line output is garbled.

image

Can we set setlocale so that the nmap outputs the correct local time?

nmap/nmap.cc

Lines 1509 to 1511 in 0dc7df9

// ISO 8601 date/time -- http://www.cl.cam.ac.uk/~mgk25/iso-time.html
if (strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M %Z", &local_time) <= 0)
fatal("Unable to properly format time");

Add before the above code, so that the program can be set to the current locale:

#ifdef _WIN32
  setlocale(LC_ALL, "");
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@XinRoom and others