mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 12:37:16 +02:00
Merge branch 'fix-accents' of https://github.com/vincent-lg/evennia into vincent-lg-fix-accents
This commit is contained in:
commit
9245e47d07
2 changed files with 4 additions and 4 deletions
|
|
@ -243,7 +243,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
line (str): Line to send.
|
||||
|
||||
"""
|
||||
line = self.try_encode(line)
|
||||
line = self.encode_output(line)
|
||||
# escape IAC in line mode, and correctly add \r\n (the TELNET end-of-line)
|
||||
line = line.replace(IAC, IAC + IAC)
|
||||
line = line.replace(b'\n', b'\r\n')
|
||||
|
|
@ -343,7 +343,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
strip_ansi=nocolor, xterm256=xterm256)
|
||||
if mxp:
|
||||
prompt = mxp_parse(prompt)
|
||||
prompt = self.try_encode(prompt)
|
||||
prompt = self.encode_output(prompt)
|
||||
prompt = prompt.replace(IAC, IAC + IAC).replace(b'\n', b'\r\n')
|
||||
prompt += IAC + GA
|
||||
self.transport.write(mccp_compress(self, prompt))
|
||||
|
|
|
|||
|
|
@ -137,9 +137,9 @@ class Session(object):
|
|||
|
||||
# helpers
|
||||
|
||||
def try_encode(self, text):
|
||||
def encode_output(self, text):
|
||||
"""
|
||||
Try to encode the given text, following the session's protocol flag.
|
||||
Encode the given text for output, following the session's protocol flag.
|
||||
|
||||
Args:
|
||||
text (str or bytes): the text to encode to bytes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue