Products | About Us

Unicode Support

Dim oFSO
Dim oTS
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oTS = oFSO.OpenTextFile("C:\Print-log.csv", 8, true)
oTS.WriteLine serialnumber & ",""" & DocumentName & """," & UserName & "," & TotalPages & "," & Date
oTS.Close

I have tried to "" document name, but seems it can't support unicode like chinese or japanese, thanks in advance!

tokenal
4th Jul 2008

We will do some testing on Monday on this and let you know how it goes.

Tony Edgecombe
4th Jul 2008

impressed with your always instant response

tokenal
4th Jul 2008

It's definitely a bug, I'll let you know when we have a fix.

Tony Edgecombe
5th Jul 2008

This has been fixed in build 1593, you can download it from http://www.frogmorecs.com/Download/SetupPD_4.1.1593.exe

Tony Edgecombe
7th Jul 2008

Great! Will update you if get it solved.

tokenal
8th Jul 2008

Hi Tony, yes it did the works.
However, it would becomes not readable if parsing from javascript for our testing. Would it be possible to encode as "DocumentName('UTF-8')" or DocumentName('shift-jis')...etc

At the moment, i can use notepad to open the csv and save as UTF-8. But it's not that good to tell the administrator do this everytime when needed.

thanks again!

tokenal
8th Jul 2008

VBScript strings are all Unicode internally.

If you try and write a string with extended characters to a ASCII/UTF-8 file the FileSystemObject throws an error.

Your best option is to force the FileSystemObject to create a Unicode file by adding a -1 to the OpenTextFile parameters. If you change this you will need to delete the existing file or it will error.

Tony Edgecombe
8th Jul 2008

yes, i did try -1 (remove the file too) before, and those characters displayed normally in windows applications i.e. notepad, excel, notepad..etc. Actually, even without -1, it is readable too after your latest build.

However, when try to parse from javascript or xmlhttprequest, it will turn to be garbadge. And did search throught the web, seems vbscript only produce unicode in UTF-16, while most web applications and system only support utf-8. Shall you confirm the strings are encoded in which unicode standard in your program via %DN%? Thanks!

tokenal
8th Jul 2008

They are Unicode in ?DN? now so you could use Unicode characters in a file name or calling an external program.

Tony Edgecombe
8th Jul 2008

Feed