FLAC support unicode? |
FLAC support unicode? |
Sep 9 2006, 10:31
Post
#1
|
|
|
Group: Members Posts: 10 Joined: 15-August 06 Member No.: 34062 |
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. |
|
|
|
![]() |
Mar 18 2012, 22:37
Post
#2
|
|
![]() Group: Members Posts: 1 Joined: 17-March 12 Member No.: 97870 |
To MiSP, whitejason and everybody who is having similar problem )
I could to offer my own version of a workaround to solve the problem with file names in Unicode on Windows. This is exactly as requested in the messages above -- slightly improved recursive script from the MiSP's post combined with the script by Egor. In my edition of the script the basic settings are in a separate section at the beginning (Adjustable parameters). There should be specified the actual path to the flac executable. Moreover, there are settings for the extensions of the source and destination files and a set of options for the encoder. In addition, during the process script prints the current working directory and names of the files which are being encoded at the moment. In my opinion, it's better than seeing only the progress for the current file, which displays flac, not knowing which particular file is re-encoded now. Now a few words about the behavior of the script. The script traverses the subtree rooted at the current directory. In each directory of the subtree, the script enumerates all files with the extension "%srcext%" and passes them through a pipe to the encoder. The result flac writes to a temporary file with a name consisting of the name of the script and the current timestamp. If the processing was successful and the temporary file has been created, it is moved to a file with the same name as the original and the extension "%dstext%". If extensions of the input and the output files are the same, then the original file will be replaced by the newly created. To change this behavior is enough to specify an output file extension different from the original, such as "reenc.flac" or something along the same lines. Below is the current version of the script (reflac.cmd), which has all the functionality described above and requires no additional tools to work: CODE ::
:: This script is a wrapper for the flac command-line tool :: to ensure proper handling of file names in unicode when transcoding :: --------------------------------------------------------------------- :: :: The script transcodes all the files with the given extension :: in the current directory and all subdirectories. If the specified :: extensions of source and destination files are the same :: the original files will be replaced by the resulting. :: :: Before use, you should specify the correct path to the flac :: executable (in adjustable parameters section). In that section :: can also be specified the extensions for the input and output :: files, as well as set of options for the encoder. :: --------------------------------------------------------------------- :: reflac (mar 2012 by jar) :: @echo off setlocal enabledelayedexpansion :: :: Adjustable parameters :: --------------------------------------------------------------------- set "encoder=с:\program files\flac\flac.exe" set "options= --best --verify" set "srcext=flac" set "dstext=flac" :: :: Print the header and create a line for underscore subheaders :: --------------------------------------------------------------------- echo. echo %~n0: transcoding all the .%srcext% files in the current subtree set "maxcol=79" for /l %%i in (1, 1, %maxcol%) do (set "uline=!uline!-") :: :: Traversing the directory subtree transcoding each target file :: --------------------------------------------------------------------- for /r %%d in (.) do ( set "dir=%%d" set "dir=!dir:~0,-2!" pushd "!dir!" set "hasfiles=" for %%f in (*.%srcext%) do ( if not defined hasfiles ( echo. echo %uline% echo directory: !dir! echo %uline% set "hasfiles=true" ) set "timestamp=!time:.=!" set "timestamp=!timestamp::=!" set "timestamp=!timestamp: =0!" set "tempfile=%~n0-!timestamp!.tmp" echo. echo processing: %%f --^> *.%dstext% echo %uline% type "%%f" 2>nul | %encoder% %options% -o "!tempfile!" - if exist "!tempfile!" ( move /y "!tempfile!" "%%~nf.%dstext%" ) ) popd ) endlocal This post has been edited by jar: Mar 18 2012, 22:54 -------------------- just jar
|
|
|
|
TaichiOrange FLAC support unicode? Sep 9 2006, 10:31
Egor Hi, currently flac tools do not support unicode fi... Sep 9 2006, 12:02
Triza Not true.
I use flac 1.1.2 on linux and unicode (... Sep 9 2006, 18:54
Firon I've had problems with special characters, tho... Sep 10 2006, 04:19
kjoonlee Not many command-line encoders seem to support Uni... Sep 10 2006, 04:29
jcoalson I need to make a FAQ out of this but haven't y... Sep 10 2006, 04:42
MiSP Is lack of Unicode support still a problem using V... Sep 22 2007, 08:06
Egor QUOTE (MiSP @ Sep 22 2007, 14:06) Is lack... Sep 22 2007, 08:28
MiSP QUOTE (Egor @ Sep 22 2007, 09:28) Try the... Sep 22 2007, 15:57
whitejason QUOTE (MiSP @ Sep 22 2007, 16:57) QUOTE (... Jun 27 2011, 19:41
MiSP Bump for great justice! Is anyone able to merg... Oct 3 2007, 19:49
MiSP Anyone? I just added a few songs to my collection ... Nov 24 2007, 20:56
smok3 QUOTE (whitejason @ Jun 27 2011, 20:41) Q... Jul 12 2011, 08:59
pedlin I had a similar problem a few years back. I had tr... Aug 27 2011, 08:03![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 22:44 |