Help - Search - Members - Calendar
Full Version: FLAC support unicode?
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
TaichiOrange
I am a newer for FLAC. I am using FLAC to convert wave files into flac. But if the filename or directory contians Chinese, the tools told me "Error: can not open input file F:\audio\---------------".

FLAC does not support UNICODE? I need to re-complile the FLAC project?

Thanks.

Egor
Hi, currently flac tools do not support unicode filenames. But you can work-around this limitation with this script:
QUOTE(flac.cmd)
@echo off
set encoder="C:\Program Files\flac-1.1.2-win\bin\flac.exe"
set tempfile=%random%%random%%random%%random%
type "%1" | %encoder% -8 - -o "%~d1%~p1%tempfile%"
ren "%~d1%~p1%tempfile%" "%~n1.flac"

Copy this to a text file and rename it to "flac.cmd", change the path to flac.exe (marked with green color). Then you will be able to use flac.cmd like this:

Examples:

F:\audio>flac.cmd 你好世界.wav

this will encode to F:\audio\你好世界.flac output file.


F:\>flac.cmd \audio\你好世界.wav

this will also encode to F:\audio\你好世界.flac
Triza
Not true.

I use flac 1.1.2 on linux and unicode (utf-8) works like a charm. I do not use Asian characters, but quite a few Easter European that are not part of the normal ASCII.

Maybe Windows is different, I dunno.

Triza
Firon
I've had problems with special characters, though some of them work, so I don't believe the FLAC tools support Unicode, at least on Windows.
kjoonlee
Not many command-line encoders seem to support Unicode filenames on Windows; if some characters from the filenames are not in your codepage, you'll get problems.

I'd use foobar2000's converter together with flac.exe to encode using %s %d. (Using pipes seems to create minor problems with seektables.)
jcoalson
I need to make a FAQ out of this but haven't yet... the basic problem is windows' implementation of unicode filenames, which can only be supported via windows APIs (non-portable), and is different for different versions of windows. I searched quite a bit and even major projects like python have rejected supporting unicode filenames because of the complexity of it (at least when I looked).

unicode filenames on pretty much any other system are not a problem.

Egor's solution for windows is best I think.

Josh
MiSP
Is lack of Unicode support still a problem using Vista?
Egor
QUOTE(MiSP @ Sep 22 2007, 14:06) *
Is lack of Unicode support still a problem using Vista?

Yes.

Try the workaround mentioned above, or use foobar2000 - it has full Unicode support and some compatibility tricks for commandline encoders like flac.exe.
MiSP
QUOTE(Egor @ Sep 22 2007, 09:28) *

Try the workaround mentioned above, or use foobar2000 - it has full Unicode support and some compatibility tricks for commandline encoders like flac.exe.

I use the following script found here on the forums (with slight modifications) for recoding FLAC files to the newest version installed:

CODE
@echo off
set encoder="C:\Program Files\FLAC\flac.exe"
for /r "." %%d in (.) do (cd %%d & for %%f in (*.flac) do %encoder% --best -V -f "%%f")


What I'm after, is making this script also work with unicode names (currently I get the "invalid argument" error). I'll try the workaround described above.

Can foobar easily recode all of the FLAC files in my music library fully automatically, just like this script can?

Edit: Tested, didn't work. I made a flac.cmd containing exactly what is described above (except for the path), and I used the script above using flac.cmd instead of flac.exe. I got the following error:

CODE
ERROR: for encoding a raw file you must specify a value for --endian, --sign, --channels, --bps, and --sample-rate
Type "flac" for a usage summary or "flac --help" for all options


Edit #2: I can't help thinking that the two scripts must be merged. Can someone do this for me? I have little knowledge of such scripting... I want the settings and the recursive functionality of the script I mentioned, and the unicode support of the workaround script.
MiSP
Bump for great justice! Is anyone able to merge the two scripts mentioned above? I haven't found out how to do it...
MiSP
Anyone? I just added a few songs to my collection with Unicode filenames, but have not been able to merge the two scripts above...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.