zer0 wrote:My initial, and current, though is that the kind of writing that XYplorer does and the kind of "Save As" Wordpad does are entirely different even though both are asked to write a TXT file.
well, they are kind of different.
AFAIK, wordpad will write the txt file using the UTF-8 encoding, while the script wil use the UTF-16 encoding.
zer0 wrote:When opened in Notepad the formatting that I would achieve if I was to open the original NFO in Wordpad and save as TXT file does not show in the converted file.
if you try to open the nfo file on notepad you'll see the text without formatting as well.
my conclusion is that wordpad somehow fixes this.
but if you only want to read the file you can use one of xyplorer's previews.
or maybe the incredibly useful
quick file edit script.
ale wrote:As a total beginner to scripting I was writing this too to learn, and had this line of code
Code: Select all
$filedata = readfile("<curbase>.nfo"); writefile("<curbase>.txt", $filedata);
or
Code: Select all
$filedata = readfile("<curbase>.nfo"); writefile("<curbase>.txt", $filedata, , tu);
to convert to Unicode
i'm no expert myself, but here are some tips:
1. you can't use <curbase>. you have to specify the whole path, and <curbase> only gives the file name without path or extension, so "<curitem>" (without .nfo) is the best choice for readfile.
it works on writefile as well, but the name of the converted file will be "file.nfo.txt". that's why i used "<curpath>\<curbase>".
2.the 1st script won't necessarily write a unicode file.
it will use ASCII encoding if possible.
the "tu" argument is what forces the script to use unicode.
3.since readfile is a function, you can put it directly inside the writefile command without having to use a variable.