omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Using 'foreign characters' in Scene

    Pythonista
    2
    3
    1656
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • upwart
      upwart last edited by

      I am trying to display 'foreign characters', like accented é and à in a Scene via Text, but that results in coercing to unicode errr. How can handle this properly?

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        First of all, make sure that at the top of the file is a comment saying # -*- coding: utf-8 -*-. Although it's only a comment, this is important for Python to know what text encoding the program uses. Then you should add the letter u before any string with foreign characters to make it a unicode object instead of normal str. (For example u"üñîçødé" instead of "üñîçødé".)

        1 Reply Last reply Reply Quote 1
        • upwart
          upwart last edited by

          @dgelessus
          That's it. Thanks.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors