mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 20:17:16 +02:00
Make sure player input is valid unicode. If an un-decodable character is encountered, replace it with question marks. We'll need to test this with a more unicode capable client than I have.
This commit is contained in:
parent
b57608cf55
commit
af19724bb2
2 changed files with 14 additions and 4 deletions
|
|
@ -133,7 +133,9 @@ class Command(object):
|
|||
"""
|
||||
Instantiates the Command object and does some preliminary parsing.
|
||||
"""
|
||||
self.raw_input = raw_input
|
||||
# If we get a unicode string with un-recognizable characters, replace
|
||||
# them instead of throwing errors.
|
||||
self.raw_input = unicode(raw_input, errors='replace')
|
||||
self.source_object = source_object
|
||||
self.session = session
|
||||
# The work starts here.
|
||||
|
|
@ -441,7 +443,8 @@ def handle(command, ignore_state=False):
|
|||
# Nothing sent in of value, ignore it.
|
||||
raise ExitCommandHandler
|
||||
|
||||
state = None #no state by default
|
||||
# No state by default.
|
||||
state = None
|
||||
|
||||
if command.session and not command.session.logged_in:
|
||||
# Not logged in, look through the unlogged-in command table.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue