Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError #389

Open
haxxus opened this issue Aug 5, 2018 · 2 comments
Open

UnicodeDecodeError #389

haxxus opened this issue Aug 5, 2018 · 2 comments

Comments

@haxxus
Copy link

haxxus commented Aug 5, 2018

Hello, i have it running for Quake 3 , we play on a mod that has special characters for names ( mod excessiveplus ) , when users with long names !register , it outputs this error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xf7 in position 20: ordinal not in range(128)

i had a friend edit the clients.py to recognize our mod names, changes starting from line 544:

            newName = name.strip()
        newName = self.fixExcessivePlusName(name)

        if self._name == newName:
            if self.console:
                self.console.verbose2('Aborted making alias for cid %s: name is the same' % self.cid)
            return
        if self.cid == '-1' or self.cid == 'Server': # bfbc2 addition
            if self.console:
                self.console.verbose2('Aborted making alias for cid %s: must be B3' % self.cid)
            return
        
        self.makeAlias(self._name)
        self._name = newName
        self._exactName = newName + '^7'

        if self.console and self.authed:
            self.console.queueEvent(self.console.getEvent('EVT_CLIENT_NAME_CHANGE', self.name, self))

    def _get_name(self):
        return self._name

    def fixExcessivePlusName(self, name):
        xpname='';
        for c in name :
            if ord(c) < 32 or ord(c) >= 127 :
                xpname+= "#" + c.encode("hex");
            else :
                xpname+= c;
        return xpname


    def _get_exactName(self):
        return self._exactName

any suggestions ?
thanks.

@isala404
Copy link
Contributor

isala404 commented Oct 2, 2018

users must had non ascii character on his name and as for my knowledge b3 only work with ascii characters. can you send whole error from the log file ?

@haxxus
Copy link
Author

haxxus commented Oct 2, 2018

b3.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants