You are not logged in.
now is perfect, many thankssssss
Offline
Hi
Sorry if I reopen this old thread but there is a problem with accented letters, if in the txt there are letters such as èòàùì the files are renamed with strange symbols
Offline
You probably need to resave your text file with UTF-8 BOM (as Unicode text).
If it doesn't resolve your issue, please share the script that you are using and provide a sample file.
Offline
thanks
the list in a txt files.
The txt, for example, contain:
01 - Il dovere è potere
02 - La notte della vittoria
03 - Bellezze al bagno
04 - George, Jerry è compagni
05 - Il campione
06 - Cuccioli sì nasce
07 - Lascia o raddoppia
and this is the preview
preview
Offline
As I said previously, you probably need to resave your text file with UTF-8 BOM (as Unicode text). Have you tried that?
If it doesn't resolve your issue, please post your script and provide a sample file (you can send it by email, see the About dialog).
Offline
Hi
Sorry if I reopen this old thread but there is a problem with accented letters,
if in the txt there are letters such as èòàùì the files are renamed with strange symbols
Don't use WindowsTM Notepad.exe to modify your text.
but an editor like Notepad2 from "flo's freeware".
- create a new file
- paste in your file names
- use menu "File > Encoding > UTF-8 with Signature"
- save and use
"UTF-8 with Signature" seems to be the same as "UTF-8 with BOM" and also adds the hidden BOM signature signs: 
You can also try to save as Unicode which also adds the BOM.
More infos about BOM at https://en.wikipedia.org/wiki/Byte_order_mark
HTH?
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
thanks den4b
thanks Stefan, your solution works perfectly, it's a little slower but if nothing else can be done, that's fine too
Offline
You might be able to use FileReadLines in combination with UTF8Decode, instead of FileReadTextLines, but I'm just guessing here, because you did not provide your script and a sample file.
P.S. The example content that you provided is the not same as an example file, because the content alone looses the original file encoding information.
Offline
yes sure but I don't see the option for add my files. I have post the files here:
thanks
edit, new url
Last edited by Lauraq (2021-10-03 10:50)
Offline
Ok, I checked your script and the text file.
Your text file uses UTF8 encoding but without identifying itself as UTF8, i.e. it is missing the BOM marker. All you have to do is resave your file with UTF8 BOM encoding, so that ReNamer and other software can determine that the content is UTF8 encoded.
Also, I have updated the script so it is now cable of loading both types of files. Set AutoDetectEncoding = False if you wish to load a UTF8 encoded file without BOM (as in your sample text file), or set AutoDetectEncoding = True to automatically determine the encoding according the file's BOM marker. Don't forget to adjust the NewNamesFile constant to suit your needs.
const
NewNamesFile = 'C:\Users\User\Downloads\Files.txt';
AutoDetectEncoding = False;
var
I: Integer;
AnsiLines: TAnsiStringArray;
UnicodeLines: TWideStringArray;
Initialized: Boolean;
begin
if not Initialized then
begin
Initialized := True;
if AutoDetectEncoding then
UnicodeLines := FileReadTextLines(NewNamesFile)
else
begin
AnsiLines := FileReadLines(NewNamesFile);
SetLength(UnicodeLines, Length(AnsiLines));
for I := 0 to Length(AnsiLines)-1 do
UnicodeLines[I] := UTF8Decode(AnsiLines[I]);
end;
I := 0;
end;
if I < Length(UnicodeLines) then
begin
FileName := UnicodeLines[I] + WideExtractFileExt(FileName);
I := I + 1;
end;
end.
Offline