Script may not work in non English version

Help with writing and running scripts

Script may not work in non English version

Postby Koomier » Tue Oct 30, 2012 4:08 am

I met a problem when testing scripts in non English version. Some command not work well in non english version

When using a script to create a new file and trying to write something into it.
The UltraEdit just created the new file and nothing write into the newfile.


Testing environment: 18.20.0.1021 (Chinese) --script not work
English version --works well
Code: Select all
UltraEdit.newfile();
UltraEdit.activeDocument.write("test");


Anyone know how to avoid this (if this is a bug) by using other method.
Koomier
Newbie
 
Posts: 3
Joined: Tue Oct 30, 2012 3:56 am

Re: Script may not work in non English version

Postby Mofi » Tue Oct 30, 2012 5:34 am

Make sure that the script file is an ASCII/ANSI file with DOS line terminators. The Javascript interpreter cannot interpret Unicode files as often used in Asian countries. UTF-8 or UTF-16 script files are not support and a BOM (byte order mark) results in an error message by Javascript interpreter written to output window on script execution. Writing Chinese characters into a Unicode file with a script is therefore a big challenge.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3937
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Script may not work in non English version

Postby Koomier » Wed Oct 31, 2012 12:47 am

Dear Mofi,

Thank you for your reply.
I have checked and convert it to different file types, but it's not work.
I also download the script of yours : FindStringstoNewfile.js, and add a UltraEdit.activeDocument.write("test"); after a UltraEdit.newfile(); it also failed.

Because of the same script ran successfully in English version, but failed in non English version, so I do not think we can conclude the reason as a Chinese character or file type issue.

If you have time, I hope you can download a UltraEdit of Chinese version, and jut test the two line script like above.
Koomier
Newbie
 
Posts: 3
Joined: Tue Oct 30, 2012 3:56 am

Re: Script may not work in non English version

Postby Mofi » Wed Oct 31, 2012 1:16 am

I will not download, install and test Chinese version of UltraEdit. I'm a user like you with the difference of being not interested in Chinese version of UltraEdit.

Please contact IDM support by email by clicking on email us directly at top of this page describing the problem with Simplified or Traditional Chinese version of UltraEdit. Add the two lines you use also to the email. Don't attach the *.js file as this often results in blocking the email by antivirus / malware protection systems. You can attach the script file with a different extension like TXT, but for just the 2 lines it is easier to simple copy them into the email.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 3937
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Script may not work in non English version

Postby Koomier » Thu Nov 01, 2012 1:58 am

Thank you very much.
I will report this to the support team.
I am also using the English version. But when I shared my script online, one guy report me this.
Anyway, thank you
Koomier
Newbie
 
Posts: 3
Joined: Tue Oct 30, 2012 3:56 am

Re: Script may not work in non English version

Postby Andy Li » Tue Jan 01, 2013 3:41 am

I think if you change UltraEdit.newfile(); to UltraEdit.newFile(); your code will work.
Andy Li
Newbie
 
Posts: 1
Joined: Tue Jan 01, 2013 1:35 am


Return to Scripts