Changeset 928:3b16c095d166


Ignore:
Timestamp:
04/27/19 12:20:37 (6 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Unicode handling changes (re #347).

Location:
src/mlx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/i18n.py

    r919 r928  
    5151    If not found, the fallback language is searched. If that is not found
    5252    either, the key itself is returned within curly braces."""
    53     return _translation.ugettext(key)
     53    return _translation.gettext(key)
    5454   
    5555#------------------------------------------------------------------------------
  • src/mlx/pyuipc_sim.py

    r922 r928  
    606606            return int(self.zfw * 256.0 * const.KGSTOLB)
    607607        elif offset==0x3c00:       # Path of the current AIR file
    608             return self.airPath
     608            return bytes(self.airPath, "iso-8859-1")
    609609        elif offset==0x3d00:       # Name of the current aircraft
    610             return self.aircraftName
     610            return bytes(self.aircraftName, "iso-8859-1")
    611611        elif offset==0x6202:       # PMDG 737NG switches
    612612            return self.pmdg_737ng_switches
  • src/mlx/rpc.py

    r923 r928  
    470470
    471471        md5 = hashlib.md5()
    472         md5.update(password)
     472        md5.update(password.encode("utf-8"))
    473473        self._passwordHash = md5.hexdigest()
    474474
  • src/mlx/web.py

    r923 r928  
    10141014                data = f.read(16384)
    10151015                while data:
    1016                     parser.feed(data)
     1016                    parser.feed(str(data))
    10171017                    data = f.read(16384)
    10181018            finally:
     
    10511051            result = Result()
    10521052            result.metars = {}
    1053             for line in iter(f.readline, ""):
     1053            for line in f.readlines():
     1054                line = str(line, "iso-8859-1")
    10541055                if len(line)>5 and line[4]==' ':
    10551056                    icao = line[0:4]
Note: See TracChangeset for help on using the changeset viewer.