Code: Select all
$Path = "<curitem>";
$Encoding = Base64Encode($Path, 2);
WriteFile("<curitem>.Base64.txt", $Encoding, , "t");
$File = Base64Decode($Encoding, 0);
WriteFile("<curitem>.after.txt", $File, , "t");Code: Select all
$Path = "<curitem>";
$Encoding = Base64Encode($Path, 2);
WriteFile("<curitem>.Base64.txt", $Encoding, , "t");
$File = Base64Decode($Encoding, 0);
WriteFile("<curitem>.after.txt", $File, , "t");So I tested that and no it does not work. Furthermore, the Base64 file that was created, when I decoded that, the text in the file were the same but when comparing the hex values, it was missing a value. Basically missing a byte. When I changed the file ENCODETEST.txt to UTF-16 however, decoding the Base64 file works perfectly. However, the *.after.txt file still does not work.admin wrote:OK, this seems to work for Marco's case:But does it work in Japanese locale?Code: Select all
$Path = "<curitem>"; $Encoding = Base64Encode($Path, 2); WriteFile("<curitem>.Base64.txt", $Encoding, , "t"); $File = Base64Decode($Encoding, 0); WriteFile("<curitem>.after.txt", $File, , "t");
Code: Select all
// Base64 encode/decode, directly from/to file
$curitem = <curitem>;
$Encoding = Base64Encode($curitem, 2, "$curitem.Base64.txt");
Base64Decode($Encoding, 0, "$curitem.after.txt");
Code: Select all
' syntax: base64decode(text, [flags], [targetfile])
' text: text to decode
' flags:
' 1 = originally encoded string was unicode (no need to convert return string to unicode)
' 2 = input string points to file
' targetfile: write decoded bytes to this file (not affected by return string format)
' on exist file is overwritten without asking
Code: Select all
// Base64 encode/decode, directly from/to file
$curitem = <curitem>;
$curext = <curext>;
$Encoding = Base64Encode($curitem, 2, "$curitem.Base64.txt");
Base64Decode($Encoding, 0, "$curitem.after.$curext");