diff --git a/telegram_trigger_bot.py b/telegram_trigger_bot.py index f28c48c..50b8678 100644 --- a/telegram_trigger_bot.py +++ b/telegram_trigger_bot.py @@ -5,6 +5,7 @@ Telegram Trigger Bot - Declanșează BTGO Scraper prin comandă Telegram import os import sys +import io import subprocess import logging import json @@ -25,6 +26,10 @@ CHAT_ID = os.getenv('TELEGRAM_CHAT_ID') POLL_TIMEOUT = int(os.getenv('TELEGRAM_POLL_TIMEOUT', 60)) # Default 60 secunde # Logging - force stdout instead of stderr (for Windows service logging) +# Set UTF-8 encoding for stdout to support Romanian characters +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') +sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace') + logging.basicConfig( level=logging.INFO, format='[%(asctime)s] [%(levelname)s] %(message)s',