Results 1 to 3 of 3

Thread: Python interpreter coding?

Threaded View

  1. #1
    Join Date
    Apr 2008
    Beans
    318
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Python interpreter coding?

    Code:
    # -*- coding: utf-8 -*-
    The above is a line of code I like to put in most of my Python scripts. This makes everything work as if it's UTF-8 without having to go through lots of coding differences and rigmarole (no typing u"á"; just "á"). Particularly in this case, I don't end up having to see and deal with sequences like this: '\xc3\xa1'

    Anyway, I'm just wondering how to do the same thing from the Python interpreter. Any ideas? Is there a config setting somewhere?

    I'm aware that half of the escape sequence output I'm getting is probably the terminal's fault, but I'm just wondering what the equivalent to the code I cited above is.
    Last edited by kumoshk; May 10th, 2013 at 03:36 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •