Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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 tonigi...@googlemail.com on 8 Nov 2014 at 1:08

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions