String (@NotNull Map<String, String> env, @NotNull Charset charset) { Locale locale = Locale.getDefault(); String language = locale.getLanguage(); String country = locale.getCountry(); String languageTerritory = "en_US"; if (!language.isEmpty() && !country.isEmpty()) { String languageTerritoryFromLocale = language + '_' + country; if (checkIfLocaleAvailable(languageTerritoryFromLocale)) { languageTerritory = languageTerritoryFromLocale ; } } String result = languageTerritory + '.' + charset.name(); env.put(LC_CTYPE, result); return result; }