View Full Version : Unicode in bat and scenecut
juGGaKNot
30th July 2009, 14:13
1 - I want to add other languages for my bat but some are unicode and they do not show up right in a .txt
echo.
echo Press A for English
echo.
echo Press B for Romanian
echo.
"%mypath%\bin\choice.exe" /C:AB /N /t:a,10 "Your choice : "
IF errorlevel 2 goto A2
IF errorlevel 1 goto A1
:A1
set /p langa=<"%myfiles%\roma.docx"
set /p langb=<"%myfiles%\romb.docx"
set /p langc=<"%myfiles%\romc.docx"
set /p langd=<"%myfiles%\romd.docx"
GOTO end
:A2
set /p langa=<"%myfiles%\enga.docx"
set /p langb=<"%myfiles%\engb.docx"
set /p langc=<"%myfiles%\engc.docx"
set /p langd=<"%myfiles%\engd.docx"
GOTO end
:END
Then i will use the lang[x] for other choices, in the selected language.
The problem is that it does not read the unicode files, if i paste in the bat i have to save as unicode it crashes on execution
What can i do to read doc/docx ( or unicode .txt i guess ) and set a cvar to them ?
set /p xxx
thnx, cheers.
2 - scenecut Higher values of scenecut increase the number of scenecuts detected
My source has a lot of scene change, what value should i set ?
jmartinr
30th July 2009, 16:31
1 - I want to add other languages for my bat but some are unicode and they do not show up right in a .txt
I don't really understand what you're trying to do, but a "chcp 1252" might be helpful in your bat.
juGGaKNot
30th July 2009, 17:45
I use choice to select some stuff and i want it to be in other languages also
for ex
set /p langb=<"%myfiles%\romb.docx"
set /p langb=<"%myfiles%\engb.docx"
sets langb to english and romanian, if b romanian if a english so the folowing text
echo %langb%
will be in english if the user enters a or romanian if b
and i want to add more languages, some are unicode and i can't get the bat to read the docx/doc files
i will search for "chcp 1252"
juGGaKNot
30th July 2009, 18:59
I don't really understand what you're trying to do, but a "chcp 1252" might be helpful in your bat.
Read more about what you said, does not help
i have to copy the language in the bat ( savind as unicode will make it not work )
or
save to a file and read it then write to a variable but i can't read unicode files
for ex
Нажмите Y для выключения компьютера после завершения кодирования, нажмите N, если выключение не требуется :
looks like
??????? Y ??? ?????????? ?????????? ????? ?????????? ???????????, ??????? N, ???? ?????????? ?? ????????? :
is a save ascii and if i save unicode the bat crashes
jmartinr
30th July 2009, 21:46
If I put this:
Нажмите Y для выключения компьютера после завершения кодирования, нажмите N, если выключение не требуется
in a UTF-8 file with BOM, and use the following cmd-file:
chcp 1252
set /p langb=<txtutf8.txt
echo %langb%>t.txt
type t.txt
pause
I get:
C:\My Videos\test unicode>chcp 1252
Actieve codetabel: 1252
C:\My Videos\test unicode>set /p langb= 0<txtutf8.txt
C:\My Videos\test unicode>echo Нажмите Y для выключения
омпьютера после завершения кодирования, на
жмите N, если выключение не требуется 1>t.txt
C:\My Videos\test unicode>type t.txt
Нажмите Y для выключения компьютера после
завершения кодирования, нажмите N, если выкл
ючение не требуется
C:\My Videos\test unicode>pause
Druk op een toets om door te gaan. . .
So reading and writing is possible.
Using it and changing code pages. That's were I guess the hard part is.
juGGaKNot
31st July 2009, 09:15
ah, great, the ascii ones i will paste in the bat and the unicode ones i will read with the codes
I have finished 4 languages
echo.
echo Press A for English
echo.
echo Apasa B pentru Romana
echo.
echo Tryk C for dansk
echo.
echo Tryck D fr svenska
echo.
"%mypath%\bin\choice.exe" /C:ABCD /N /t:a,30 "Your choice : "
IF errorlevel 4 goto A4
IF errorlevel 3 goto A3
IF errorlevel 2 goto A2
IF errorlevel 1 goto A1
:A1
set langb=Press Y to SHUTDOWN the PC after encoding, Press N not to :
set langc=Press Y to use what bitrate you want, Press N to use the auto bitrate :
set langd=Press Y to encode X264, Press N to encode X264 and XVID!
GOTO end
:A2
set langb=Apasa Y pentru SHUTDOWN dupa encodare, Apasa N pentru no SHUTDOWN :
set langc=Apasa Y pentru a alege bitrate, Apasa N pentru autobitrate :
set langd=Apasa Y pentru x264, Apasa N pentru X264 si XVID!
GOTO end
:A3
set langb=Tryk Y for at LUKKE computeren efter indkodning, ellers tryk N :
set langc=Tryk Y for at bruge et oensket antal bitrate, tryk N for at bruge den automatiske bitrate :
set langd=Tryk Y for at indkode X264, tryk N for at indkode X264 og XVID!
GOTO end
:A4
set langb=Tryck Y fr att stnga av datorn efter komprimeringen, tryck N fr att inte gra det :
set langc=Tryck Y fr att stta en bithastighet, tryck N fr att anvnda den automatiska hastigheten :
set langd=Tryck Y fr att komprimera i x264, tryck N fr att komprimera x264 och XviD!
GOTO end
thnx, i'll take it from here, the list of codes should be easy to find on google.
jmartinr
31st July 2009, 12:27
Please post back how you did it. On second thought I'm very doubtfull about a UTF solution (with or without BOM).
Maybe you could use "TYPE" as a workaround since that types unicode files to the terminal just fine.
juGGaKNot
31st July 2009, 12:40
i will, about 2-3 days, right now i'm doing the non unicode
i think type without setting a cvar in the bat, direct read.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.