send report in python added, UTF encoding voor windows update

This commit is contained in:
Mark Kors
2025-10-31 08:52:25 +01:00
parent 288b7cd162
commit 83c78f01ff
2 changed files with 77 additions and 0 deletions

View File

@@ -8,8 +8,17 @@ import mysql.connector
from datetime import datetime, timedelta
import argparse
import sys
import io
import os
from typing import List, Dict, Optional
os.environ['PYTHONIOENCODING'] = 'utf-8'
# Forceer UTF-8 encoding voor stdout/stderr op Windows
if sys.platform == 'win32':
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
class SteVeReporter:
def __init__(self, host: str, database: str, user: str, password: str, port: int = 3306,
price_host: str = None, price_port: int = None, price_user: str = None, price_password: str = None):