VBS Base64 encoding , The following code can support Unicode
Function FileBase64Enc(ByVal strFilePath)
Dim fso,WshShell,TmpFilePath,oReadFile
Const ForReading = 1
Const MyBirthDay = 1228
Const WINDOW_HIDE = 0
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("Wscript.Shell")
TmpFilePath = fso.GetSpecialFolder(2) & "\" & Fix(Rnd * MyBirthDay) & ".TMP"
WshShell.Run "Certutil.EXE -ENCODE """ & strFilePath & """ """ & TmpFilePath & """" ,WINDOW_HIDE ,True
Set oReadFile = fso.OpenTextFile(TmpFilePath,ForReading)
oReadFile.ReadLine 'Skip the "----- BEGIN CERTIFICATE -----" flag on the first line
Dim Str
While Str <> "-----END CERTIFICATE-----"
FileBase64Enc = FileBase64Enc & Str
Str = oReadFile.ReadLine
Wend
oReadFile.Close
fso.DeleteFile TmpFilePath
End Function