gst-launch: Does not support non-UTF8 shell
Submitted by Martin Proksa
Writing stream to file with local characters in filename fails on windows to open file with that name. Same filename works fine on linux.
example of problem:
gst-launch-1.0 videotestsrc ! filesink location=tést.raw
WARNING: erroneous pipeline: no element "filesink"
gst-launch-1.0 videotestsrc ! filesink location=test.raw
Problem is in function gst_fopen in file gstfilesink.c, this function expect its argument filename to be in UTF8, but in fact filename is in ASCII and character é is represented as single BYTE 0xE9.
Converting filename to UTF8 before calling g_utf8_to_utf16 solves the problem.
gchar *ufilename = g_locale_to_utf8(filename, -1, NULL, NULL, NULL);
wchar_t *wfilename = g_utf8_to_utf16 (ufilename, -1, NULL, NULL, NULL);