my system encoding is UTF-8<br><br>chris@chris-Aspire-5732Z:~$ python<br>Python 2.7.2+ (default, Feb 16 2012, 18:29:42) <br>[GCC 4.6.2] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import sys<br>>>> sys.getfilesystemencoding()<br>'UTF-8'<br>>>> <br><br>how can i use discoverer if i dont use discover_uri with file:// ?<br>can i?<br><br>so is there any way to solve this?<br>
<br><div class="gmail_quote">2012/3/9 Tim-Philipp Müller <span dir="ltr"><<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Thu, 2012-03-08 at 20:31 +0200, Χρήστος Τριανταφύλλης wrote:<br>
<br>
> i have this line<br>
><br>
> info = newitem.discover_uri(("file://" + path).encode('utf-8'))<br>
><br>
> and with the .encode() it works with everything i enter on path<br>
> variable but when<br>
> the path variable contains a letter with a tone in greek , for example<br>
> "/home/chris/Μουσική"<br>
> the tone is the ' above the letter "η" at the end of the string in our<br>
> current example, i get this error<br>
><br>
> info = newitem.discover_uri(("file://" + path).encode('utf-8'))<br>
> glib.GError: Δεν βρέθηκε ο πόρος.<br>
><br>
> the "Δεν βρέθηκε ο πόρος." can be translated to "the source hasn't<br>
> been found", something like that :P<br>
><br>
> do you have any idea how to solve this?<br>
<br>
</div></div>To repeat what I said last time:<br>
<br>
On Linux/*nix a filename path is just a bunch of bytes. It may be in any<br>
(8-bit) encoding, ISO-8859-X, UTF-8, whatever. You need to acquire the<br>
filename/filepath in the file system encoding or convert it to the<br>
encoding used. It's a bit of a mess, esp. with the python layer on top,<br>
but I'm sure there are docs somewhere that explain it in more detail.<br>
Then you need to create a URI from that file path. Prefixing it with<br>
'file://' may sometimes work, but is not correct and won't work with<br>
relative paths either.<br>
<br>
GStreamer (on Linux) expects a URI that expresses the file path in file<br>
system encoding. This isn't necessarily UTF-8, but might be. (We don't<br>
know.)<br>
<br>
Cheers<br>
-Tim<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br>