How to do special encode in string ?

Discussion in 'Python' started by fowlertrainer@anonym.hu, Jun 22, 2004.

  1. Guest

    Hi !

    I'm hungarian, we use special characters like:
    á - a'
    õ -o"

    etc.

    I want to encode this characters to in config file I see these
    characters as \nnn format.
    And I want to decode it automatically with python.

    How to I do it without write complex converter tool ?

    Thanx for it:
    FT

    Example:
    Encode("az állam én vagyok") -> "az \xe1llam \xe9n vagyok"

    Decode("az \xe1llam \xe9n vagyok") -> "az állam én vagyok"
     
    , Jun 22, 2004
    #1
    1. Advertisements

  2. This recipe may be helpful

    <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/251871>

    /Jean Brouwers


    In article <>,
    <""> wrote:

    > Hi !
    >
    > I'm hungarian, we use special characters like:
    > á - a'
    > õ -o"
    >
    > etc.
    >
    > I want to encode this characters to in config file I see these
    > characters as \nnn format.
    > And I want to decode it automatically with python.
    >
    > How to I do it without write complex converter tool ?
    >
    > Thanx for it:
    > FT
    >
    > Example:
    > Encode("az állam én vagyok") -> "az \xe1llam \xe9n vagyok"
    >
    > Decode("az \xe1llam \xe9n vagyok") -> "az állam én vagyok"
    >
    >
     
    Jean Brouwers, Jun 22, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Soefara
    Replies:
    2
    Views:
    4,968
    Soefara
    Feb 11, 2004
  2. Replies:
    1
    Views:
    807
    Tilman Bohn
    Dec 13, 2004
  3. John_Woo
    Replies:
    4
    Views:
    784
    shakah
    Jul 6, 2006
  4. Replies:
    3
    Views:
    478
    Chris King
    Jun 23, 2004
  5. Replies:
    2
    Views:
    427
    Scott David Daniels
    Jun 23, 2004
  6. sumit
    Replies:
    0
    Views:
    535
    sumit
    Mar 10, 2012
  7. Stefan Braun

    SOAP::Lite, encode and special characters

    Stefan Braun, May 9, 2007, in forum: Perl Misc
    Replies:
    0
    Views:
    286
    Stefan Braun
    May 9, 2007
  8. Peng Yu
    Replies:
    3
    Views:
    316
    C.DeRykus
    Jul 13, 2010
Loading...