peircej / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

MS Windows and utf-8 issues #172

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Windows XP doesn't use utf-8.

I press an accentuated letter to tag a photo (é, à, ç) and i have a python 
error ("can't decode byte").

In the folder "tést" (accentuated letter), i right click on a photo / 
operations / open in explorer, i get an error message from the Windows Explorer 
saying that the folder "tést" doesn't exist.

jbrout 0.3.284, Win XP
(Are these bugs present in vista and seven?)

Original issue reported on code.google.com by p...@gmx.fr on 12 Oct 2010 at 11:12

GoogleCodeExporter commented 8 years ago
An other little thing.
Under windows, you can do Alt+0201 (on the numpad) to produce a É.
This thing doesn't work with a jbrout textbox.
Not sure we can do something about it.

Original comment by p...@gmx.fr on 22 Oct 2010 at 5:03

GoogleCodeExporter commented 8 years ago
For the openExplorer bug ("tést" doesn't exist)

## in plugins\openExplorer\__init__.py

runWith(["xdg-open","nautilus","rox","konqueror","explorer.exe"],unicode(node.fi
le).encode('cp1252'))

runWith(["xdg-open","nautilus","rox","konqueror","explorer.exe"],path.encode('cp
1252'))

## in jbrout\common.py
remove the line 58 (in r320), in runWith()
assert type(file)==unicode

I just added .encode('cp1252') before calling runWith, so the explorer gets a 
CP-1252 filename and can find it.
It's a hard fix, only valid under windows.
This works under Win XP, but the filesystem encoding needs to be known before 
to be sent.
We could try if sys.platform[:3].lower() == "win":, but it could lie with 
windows partition mounted under linux, and i don't know the charset of Vista 
ans Seven.

Original comment by p...@gmx.fr on 7 Nov 2010 at 4:01

GoogleCodeExporter commented 8 years ago
(In reply to comment #1)
> This thing doesn't work with a jbrout textbox.
> Not sure we can do something about it.

This is most likely bug in Gtk+ ... http://is.gd/7DCazu

Original comment by matej.c...@gmail.com on 6 Dec 2011 at 10:45

GoogleCodeExporter commented 8 years ago
(In reply to comment #2)
> 
runWith(["xdg-open","nautilus","rox","konqueror","explorer.exe"],unicode(node.fi
le).encode('cp1252'))

This is certainly not acceptable as it is, but we can try to generalize it a 
bit. What do you get when you run (inside of python)

import locale
print locale.getpreferredencoding()

Thank you

Original comment by matej.c...@gmail.com on 6 Dec 2011 at 10:48

GoogleCodeExporter commented 8 years ago
on windows : it's better to use "mbcs" in place of cp1252 ...

Original comment by manat...@gmail.com on 6 Dec 2011 at 10:59

GoogleCodeExporter commented 8 years ago
(In reply to comment #5)
> on windows : it's better to use "mbcs" in place of cp1252 ...

Sure, but I was after an universal solution which would work on Mac and Linux 
as well.

Original comment by matej.c...@gmail.com on 6 Dec 2011 at 11:13

GoogleCodeExporter commented 8 years ago

Original comment by matej.c...@gmail.com on 12 Aug 2013 at 10:22