mirror of
git://git.acid.vegas/scroll.git
synced 2024-11-24 17:16:39 +00:00
Finally fixed character encoding issue not playing files with UTF-16 & other encodings
This commit is contained in:
parent
24a3e1b1fc
commit
9d120737c3
@ -155,7 +155,11 @@ class Bot():
|
|||||||
else:
|
else:
|
||||||
await self.action(chan, 'the ascii gods have chosen... ' + color(name, cyan))
|
await self.action(chan, 'the ascii gods have chosen... ' + color(name, cyan))
|
||||||
for line in ascii:
|
for line in ascii:
|
||||||
await self.sendmsg(chan, line.decode(chardet.detect(line)['encoding']).replace('\n','').replace('\r','') + reset)
|
try:
|
||||||
|
line = line.decode().replace('\n','').replace('\r','')
|
||||||
|
else:
|
||||||
|
line = line.encode(chardet.detect(line)['encoding']).decode() # Get fucked UTF-16
|
||||||
|
await self.sendmsg(chan, line + reset)
|
||||||
await asyncio.sleep(throttle.message)
|
await asyncio.sleep(throttle.message)
|
||||||
else:
|
else:
|
||||||
await self.irc_error(chan, 'invalid name', name)
|
await self.irc_error(chan, 'invalid name', name)
|
||||||
|
Loading…
Reference in New Issue
Block a user