[wingide-users] Mercurial and UTF-8

Harald Thingelstad harald at thingelstad.org
Sat Mar 26 08:14:29 MDT 2011


On Fri, 25 Mar 2011 16:07:16 -0400
Wingware Support <support at wingware.com> wrote:

> On 3/25/11 3:20 PM, Harald Thingelstad wrote:
> > I have recently bought Wingide and it's great (of course) but I
> > have a few problems.
> >
> > First to go is my trouble with Mercurial integration and
> > international characters. (I thought I saw a tip on how to improve
> > the Vim keyboard personality somewhere so I'll leave that for
> > later.)
> >
> > I use Mercurial as favorite for my small projects. But trying to
> > write commit messages in Wingide gives me trouble with the
> > (for me) common letters æ, ø and å.
> >
> > Commits ends up failing with messages like these:
> > base.py
> > transaction abort!
> > rollback completed
> > abort: decoding near 'bort lus. æøå': 'ascii' codec can't decode
> > byte 0xc3 in position 15: ordinal not in range(128)!
> 
> What is the output if you type the following if you type it in Wing's 
> private Python interpreter (which should be 
> /usr/lib/wingide4.0/bin/PyCore/python in your case, I think)?
> 
> sys.getfilesystemencoding()
> sys.getdefaultencoding()
> 
> Thanks,
> 

:-)

Here it is:

harald at meri:~$ /usr/lib/wingide4.0/bin/PyCore/python
Python 2.5.5 (r255:77872, Dec  8 2010, 14:40:32) 
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getfilesystemencoding()
'UTF-8'
>>> sys.getdefaultencoding()
'ascii'
>>> import os
>>> os.getenv('LANG')
'nb_NO.UTF-8'
>>> 

Hope it helps! (I think I have a fairly normal Debian Squeeze, even if
the installation has been through some years now, mostly on testing.
I've also done a full downgrade from early Wheezy (current testing)
due to big changes going on (with low stability). 

I think it would be easiest to grab default encoding from environment
variables? My default Python says:

harald at meri:~$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getfilesystemencoding()
'UTF-8'
>>> sys.getdefaultencoding()
'ascii'
>>> import os
>>> os.getenv('LANG')
'nb_NO.UTF-8'
>>> 

and

harald at meri:~$ python3
Python 3.1.3 (r313:86834, Nov 28 2010, 11:28:10) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getfilesystemencoding()
'utf-8'
>>> sys.getdefaultencoding()
'utf-8'
>>> import os
>>> os.getenv('LANG')
'nb_NO.UTF-8'
>>> 





More information about the wingide-users mailing list