mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
[V3 Core] Encoding issue fix (#1365)
* Don't let the system encoding screw with things, specify opens as happening with utf-8 encoding * And also deal with encoding issues because windows is a special snowflake (see: #1366) * let's just use the encoding param in str() rather than encode/decode...
This commit is contained in:
@@ -140,7 +140,10 @@ def init_events(bot, cli_flags):
|
||||
|
||||
print(Fore.RED + INTRO)
|
||||
print(Style.RESET_ALL)
|
||||
print(bordered(INFO, INFO2, ascii_border=ascii_border))
|
||||
print(
|
||||
str(bordered(INFO, INFO2, ascii_border=ascii_border),
|
||||
encoding='utf-8', errors='replace')
|
||||
)
|
||||
|
||||
if invite_url:
|
||||
print("\nInvite URL: {}\n".format(invite_url))
|
||||
|
||||
@@ -180,9 +180,9 @@ class CogI18n:
|
||||
try:
|
||||
|
||||
try:
|
||||
translation_file = locale_path.open('ru')
|
||||
translation_file = locale_path.open('ru', encoding='utf-8')
|
||||
except ValueError: # We are using Windows
|
||||
translation_file = locale_path.open('r')
|
||||
translation_file = locale_path.open('r', encoding='utf-8')
|
||||
self._parse(translation_file)
|
||||
except (IOError, FileNotFoundError): # The translation is unavailable
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user