Interpreting Unicode scripts

Discussion in 'Python' started by Keith MacDonald, Feb 5, 2006.

  1. Hello,

    I am considering embedding Python in a C++ application, which works
    internally in UTF-16. The only API I can find for running scripts is
    PyRun_SimpleString(const char*). Does that mean that Python is unable to
    execute scripts containing characters from more than one code page?

    Thanks,
    Keith MacDonald
     
    Keith MacDonald, Feb 5, 2006
    #1
    1. Advertising

  2. Keith MacDonald wrote:

    > I am considering embedding Python in a C++ application, which works
    > internally in UTF-16. The only API I can find for running scripts is
    > PyRun_SimpleString(const char*). Does that mean that Python is unable to
    > execute scripts containing characters from more than one code page?


    reading PEP 263 might help:

    http://www.python.org/peps/pep-0263.html

    (summary: encode as utf-8, prepend "# coding: utf-8\n", and you're done)

    </F>
     
    Fredrik Lundh, Feb 5, 2006
    #2
    1. Advertising

  3. That document did help, thanks, although I was initially disconcerted to see
    that it's written in the future tense. Anyway, it works with Python 2.4.

    Keith MacDonald

    "Fredrik Lundh" <> wrote in message
    news:...
    >
    > reading PEP 263 might help:
    >
    > http://www.python.org/peps/pep-0263.html
    >
    > (summary: encode as utf-8, prepend "# coding: utf-8\n", and you're done)
    >
    > </F>
    >
    >
    >
     
    Keith MacDonald, Feb 5, 2006
    #3
    1. Advertising

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. Rob Meade

    Interpreting the error message?

    Rob Meade, Jan 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    408
    Rob Meade
    Jan 28, 2004
  2. Jan Danielsson
    Replies:
    8
    Views:
    670
    Mike Meyer
    Jul 22, 2005
  3. Jp Calderone
    Replies:
    0
    Views:
    483
    Jp Calderone
    Jul 21, 2005
  4. davidj411
    Replies:
    0
    Views:
    586
    davidj411
    Jun 27, 2008
  5. Replies:
    13
    Views:
    582
    Anno Siegel
    Sep 10, 2007
Loading...

Share This Page