diff --git a/Changelog.md b/Changelog.md index 8b9fa530c..99aa6ebb8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,7 +11,7 @@ Compiler Features: Bugfixes: * Yul IR Code Generation: Optimize embedded creation code with correct settings. This fixes potential mismatches between the constructor code of a contract compiled in isolation and the bytecode in ``type(C).creationCode``, resp. the bytecode used for ``new C(...)``. - + * Fix internal error for locales with unusual capitalization rules. Locale set in the environment is now completely ignored. ### 0.8.12 (2022-02-16) diff --git a/solc/main.cpp b/solc/main.cpp index ce69d20a7..50a6a8fc5 100644 --- a/solc/main.cpp +++ b/solc/main.cpp @@ -27,40 +27,16 @@ #include -#include #include using namespace std; using namespace solidity; -/* -The equivalent of setlocale(LC_ALL, "C") is called before any user code is run. -If the user has an invalid environment setting then it is possible for the call -to set locale to fail, so there are only two possible actions, the first is to -throw a runtime exception and cause the program to quit (default behaviour), -or the second is to modify the environment to something sensible (least -surprising behaviour). - -The follow code produces the least surprising behaviour. It will use the user -specified default locale if it is valid, and if not then it will modify the -environment the process is running in to use a sensible default. This also means -that users do not need to install language packs for their OS. -*/ -static void setDefaultOrCLocale() -{ -#if __unix__ - if (!std::setlocale(LC_ALL, "")) - { - setenv("LC_ALL", "C", 1); - } -#endif -} int main(int argc, char** argv) { try { - setDefaultOrCLocale(); solidity::frontend::CommandLineInterface cli(cin, cout, cerr); return cli.run(argc, argv) ? 0 : 1; }