Giter VIP home page Giter VIP logo

Comments (3)

kaosengr avatar kaosengr commented on May 30, 2024

Changed the print statement on line 70 to

print("<!-- Decoding symbol " + str(c) + ": \"" + symbol + "\" -->")

doesn't print the symbol being converted in the svg comments but not really needed.

More could be removed - ": ""

from xbox-tools.

JayFoxRox avatar JayFoxRox commented on May 30, 2024

For reference, the error is in:

print("<!-- Decoding symbol " + str(c) + ": \"" + symbol + "\" -->")

The problem is that @kaosengr is using the Windows CMD prompt, which is an ASCII terminal. Here's how I reproduced it:

$ python2 -c "print(u'\xa0')" 
$ PYTHONIOENCODING=ascii python2 -c "print(u'\xa0')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128)
$ PYTHONIOENCODING=ascii python3 -c "print(u'\xa0')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character '\xa0' in position 0: ordinal not in range(128)

The backslash-removal simply broke printing of symbol, hence you worked around the crash by accident. A better workaround is to remove that line altogether.

However, to fix this problem for everyone, we should add an error handler for this line, which catches the error and simply doesn't print the symbol part (symbol) of the message, if the terminal can't print it.
I don't think I'll fix it myself - you found your workaround anyway (which is easy enough) and it's a rare issue (most terminals will be some form of unicode).


This issue remains open until the problem is fixed in the code.

from xbox-tools.

JayFoxRox avatar JayFoxRox commented on May 30, 2024

Closed, because project moved to https://github.com/XboxDev/xtf-converter

An equivalent issue has been created on the new upstream.

from xbox-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.