Problem in discover_uri with tone at greek words

Χρήστος Τριανταφύλλης christriant1995 at gmail.com
Fri Mar 9 04:03:21 PST 2012


my system encoding is UTF-8

chris at chris-Aspire-5732Z:~$ python
Python 2.7.2+ (default, Feb 16 2012, 18:29:42)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getfilesystemencoding()
'UTF-8'
>>>

how can i use discoverer if i dont use discover_uri with file:// ?
can i?

so is there any way to solve this?

2012/3/9 Tim-Philipp Müller <t.i.m at zen.co.uk>

> On Thu, 2012-03-08 at 20:31 +0200, Χρήστος Τριανταφύλλης wrote:
>
> > i have this line
> >
> >   info = newitem.discover_uri(("file://" + path).encode('utf-8'))
> >
> > and with the .encode() it works with everything i enter on path
> > variable but when
> > the path variable contains a letter with a tone in greek , for example
> > "/home/chris/Μουσική"
> > the tone is the ' above the letter "η" at the end of the string in our
> > current example, i get this error
> >
> >   info = newitem.discover_uri(("file://" + path).encode('utf-8'))
> >   glib.GError: Δεν βρέθηκε ο πόρος.
> >
> > the "Δεν βρέθηκε ο πόρος." can be translated to "the source hasn't
> > been found", something like that :P
> >
> > do you have any idea how to solve this?
>
> To repeat what I said last time:
>
> On Linux/*nix a filename path is just a bunch of bytes. It may be in any
> (8-bit) encoding, ISO-8859-X, UTF-8, whatever. You need to acquire the
> filename/filepath in the file system encoding or convert it to the
> encoding used. It's a bit of a mess, esp. with the python layer on top,
> but I'm sure there are docs somewhere that explain it in more detail.
> Then you need to create a URI from that file path. Prefixing it with
> 'file://' may sometimes work, but is not correct and won't work with
> relative paths either.
>
> GStreamer (on Linux) expects a URI that expresses the file path in file
> system encoding. This isn't necessarily UTF-8, but might be. (We don't
> know.)
>
>  Cheers
>  -Tim
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120309/e6d1947e/attachment.htm>


More information about the gstreamer-devel mailing list