I'm using the following to rename a file:
for /f "tokens=*" %%x in (doctitle.txt) do set DOCTITLE=%%~x
move file.pdf "%DOCTITLE%.pdf"
A title string is suposed to be contained in the doctitle.txt
, i.e. "The Title of a Document" (without quotes).
It works fine, if the title string is simple (does not have accents). If title string contains accents, i.e. "açaí" the result is something like "a├ºa├¡.pdf".
How to approach this issue?
I guess the best will be to replace the characters, i.e. "açaí" becoming "acai".
As a reference, I would like to add this batch script to rename a file with string (with space) from variable.