Skip to content

Commit

Permalink
Bot: Console CodePage is now set to UTF-8 on Windows
Browse files Browse the repository at this point in the history
RenX.ServerList: Fixed a JSON error in servers_long.jsp
  • Loading branch information
JAJames committed Aug 10, 2016
1 parent b0da293 commit b1d106e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Bot/Main.cpp
Expand Up @@ -32,6 +32,10 @@
#include "Console_Command.h"
#include "IRC_Command.h"

#if defined _WIN32
#include <Windows.h>
#endif // _WIN32

using namespace Jupiter::literals;

Jupiter::INIFile o_config;
Expand Down Expand Up @@ -94,6 +98,12 @@ int main(int argc, const char **args)
Jupiter::ReferenceString command, plugins_directory, configs_directory;
size_t index;

#if defined _WIN32
// Sets console to UTF-8
SetConsoleCP(65001);
SetConsoleOutputCP(65001);
#endif // _WIN32

srand(static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()));
puts(Jupiter::copyright);
const char *configFileName = "Config.ini";
Expand Down
2 changes: 1 addition & 1 deletion RenX.ServerList/RenX_ServerList.cpp
Expand Up @@ -331,7 +331,7 @@ Jupiter::StringS server_as_long_json(const RenX::Server *server)
"Player Limit": %d,
"Vehicle Limit": %d,
"bAutoBalanceTeams": %s,
"Team Mode": %d
"Team Mode": %d,
"bSpawnCrates": %s,
"CrateRespawnAfterPickup": %f,
"Time Limit": %d
Expand Down

0 comments on commit b1d106e

Please sign in to comment.