Hi!
I'm struggling with the conversion of a UTF-8 string to latin-1. As far
as I know the way to go is to decode the UTF-8 string to unicode and
then encode it back again to latin-1?
So I tried:
'K\xc3\xb6ni'.decode('utf-8') # 'K\xc3\xb6ni' should be 'König',
contains a german 'umlaut'
but
> >
> > 'K\xc3\xb6ni'.decode('utf-8') # 'K\xc3\xb6ni' should be 'König',
>
> "Köni", to be precise.
Äh, yes.
;o)
> > contains a german 'umlaut'
> >
> > but failed since python assumes every string to decode to be ASCII?
>
> that should work, and it sure works for me:
>
> >>> s = 'K\xc3\xb6ni
Duncan Booth wrote:
> [EMAIL PROTECTED] wrote:
>
> > 'K\xc3\xb6ni'.decode('utf-8') # 'K\xc3\xb6ni' should be 'König',
> > contains a german 'umlaut'
> >
> > but failed since python assumes every string to decode to be ASCII?
>
> No, Python would assume the string to be utf-8 encoded in this cas
Michael Ströder wrote:
> [EMAIL PROTECTED] wrote:
> >
> > print 'K\xc3\xb6ni'.decode('utf-8')
> >
> > and this line raised a UnicodeDecode exception.
>
> Works for me.
>
> Note that 'K\xc3\xb6ni'.decode('utf-8') returns a Unicode object. With
> print this is implicitly converted to string. The char
I need to do some intense calculations in my application. Those are
done by a third party Python library and consume 100% CPU time for some
seconds. The computations take place in their own thread to keep my GUI
responsive (wxPython in my case).
Everything works fine on a dual core machine. On a s
Override OnLinkClicked() and check the passed link info for the 'mail:'
prefix. And if its there, don't call the OnLinkClicked() method of the
base class, to prevent wxWidgets from loading this link as a HTML
ressource.
Now, you have reduced your problem to: how do I call the standard Email
client
Great, I couldn't do better Ok, I couldn't do it all...
;o)
But I'm a little bit concerned. Have you ever thought of using a
different file prefix for python files depending on .NET assemblies
like .pyi? Sooner or later we want to associate IronPython files with
IronPython in the windows shell
I use the Visual C++ Toolkit 2003 to compile Python extension for
Python 2.4. Once installed, it works well. With and without distutils.
I also have a installation of Visual Studio 2005 on the same machine.
See:
http://www.vrplumber.com/programming/mstoolkit/
for more information.
There are a lot
Hello!
We are thinking about writing a project for several customers in
Python. This project would include (among others) wxPython, a C/C++
module. But what happens if this application generates a segmentation
fault on a customers PC. What changes do we have to trace back the
source of the error?
Hi Malcom
On Mar 10, 4:27 pm, "Malcolm Greene" <[EMAIL PROTECTED]> wrote:
> I'm new to Python and getting ready to build a small client based
> application intended to run on Windows and Linux. I was planning on
> using wxPython until I saw your comment above.
We use wxPython and Python internall
10 matches
Mail list logo