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

German umlaut not printed properly (with inelegant solution) #39

Open
GoogleCodeExporter opened this issue Mar 17, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

Hi,

first: Thank you for your effort. I have used another library before which I 
fitted a little pro my Epson but which lacked image support.
Your library has given me the great opportunity to print images and also qr 
code (cool bonus) without fumbleing myself hour per hour.

Back then i've written a little workaround for the usual umlaut-problem.

It is not very elegant but it does as needed:

    def Umlaut_toASCII(self, s):
        s=s.replace('ä', chr(132))
        s=s.replace('Ä', chr(142))
        s=s.replace('ö', chr(148))
        s=s.replace('Ö', chr(153))
        s=s.replace('ü', chr(129))
        s=s.replace('Ü', chr(154))
        s=s.replace('ß', chr(225))
        return s

    def text(self, txt):
        """ Print alpha-numeric text """
        if txt:
            self._raw(self.Umlaut_toASCII(txt))
        else:
            raise TextError()

please note that you have to set enconding in the second line for this:
# -*- coding: utf-8 -*-

Original issue reported on code.google.com by [email protected] on 8 Nov 2014 at 1:08

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

No branches or pull requests

1 participant