chore: import local project into Gitea
This commit is contained in:
59
fix_unicode.py
Normal file
59
fix_unicode.py
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Script to fix Unicode emoji characters in bot files for Windows compatibility
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
def fix_unicode_in_file(filename):
|
||||
"""Replace emoji characters with text equivalents"""
|
||||
|
||||
# Read the file
|
||||
with open(filename, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# Define emoji replacements
|
||||
replacements = {
|
||||
'🚀': '[STARTING]',
|
||||
'⚙️': '[CONFIG]',
|
||||
'🔐': '[LOGIN]',
|
||||
'✅': '[SUCCESS]',
|
||||
'❌': '[ERROR]',
|
||||
'⚠️': '[WARNING]',
|
||||
'🎯': '[TARGET]',
|
||||
'👤': '[PROCESSING]',
|
||||
'📝': '[USER BIO]',
|
||||
'🤖': '[AI]',
|
||||
'📤': '[SENDING]',
|
||||
'📨': '[RECEIVED]',
|
||||
'💬': '[MESSAGE]',
|
||||
'⏳': '[WAITING]',
|
||||
'🎉': '[COMPLETE]',
|
||||
'📊': '[STATS]',
|
||||
'🔍': '[SEARCHING]',
|
||||
'🧊': '[ICE BREAKER]',
|
||||
'🤖': '[AUTO RESPONDER]',
|
||||
'📋': '[MENU]',
|
||||
'🎯': '[SELECT]',
|
||||
'⏹️': '[STOP]',
|
||||
'👋': '[GOODBYE]',
|
||||
'🔧': '[INITIALIZING]',
|
||||
'⏰': '[SETTING UP]',
|
||||
'📈': '[PERFORMANCE]'
|
||||
}
|
||||
|
||||
# Apply replacements
|
||||
for emoji, text in replacements.items():
|
||||
content = content.replace(emoji, text)
|
||||
|
||||
# Write back to file
|
||||
with open(filename, 'w', encoding='utf-8') as f:
|
||||
f.write(content)
|
||||
|
||||
print(f"Fixed Unicode characters in {filename}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Fix both bot files
|
||||
fix_unicode_in_file("enhanced_icebreaker_bot.py")
|
||||
fix_unicode_in_file("enhanced_responder_bot.py")
|
||||
print("Unicode fixes completed!")
|
||||
Reference in New Issue
Block a user