Posted 16 years ago by sheykh-zade
Does this control support DBCS?
Is there a setting that needs to be set for this to work?

I have a string "createEvidence("Gendr","")" (the last character is Chinese, change Browser encoding if you do not see it), and if I paste this string into Syntax Editor, it turns Double-byte chars into "?".

Good news that Editor supports upper ASCII.
Bad news - we need to be able to display Chinese chars

Comments (3)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
It should work if you set on the UnicodeEnabled property. Try that out.

Actipro Software Support

Posted 16 years ago by Marianne
Am having the same issue. If you use extended ASCII characters in a string, SyntaxEditor does not render them properly. For example, open notepad and paste in the following:

Open it with SyntaxEditor. All those characters vanish. This is the case whether or not UnicodeEnabled is true.

There is a related problem when attempting to output those characters during script execution. To duplicate, save the previously made file as "test.vbs" (and let it sleep for a second so you can see the output). For example,

WScript.Sleep 1000

Save and close, then double-click on the script file to launch, the output should look like the following:


We have many customers asking that this be fixed, so the faster you can repro the problem and have us a fix, the happier they'll be, and the happier I'll be... <IMG SRC="wink.gif" border="0">

Thanks much.

------------------------------- Marianne

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
This is actually not a problem with SyntaxEditor. Here's the problem... Windows supports Unicode encoding and ASCII encoding, which are two different encodings for saving files.

We've exposed multiple overloads for saving and loading files. The default SyntaxEditor.SaveFile implementation uses UTF-8 encoding. Another overload allows you to indicate an Encoding. For that you might try selecting ASCII or one of the other ones. LoadFile has the same sort of overload.

Now to your situation. You saved a file in Notepad with those character. When you open Notepad's Save As window, at the bottom there is a dropdown for encoding. If you save it as ANSI (the default), it will not open using our default LoadFile method because we're expecting UTF-8, not ASCII. If you would use the LoadFile overload that accepts an Encoding (and you passed in the proper one), it would load. I also tried doing a Save As in Notepad with an Encoding of Unicode. Then I opened the document in SyntaxEditor the same way as before. It opened fine since the default LoadFile implementation was looking for UTF-8 encoding.

So in essence, we support all encodings. You just need to make sure you're saving and loading the correct one.

Actipro Software Support

The latest build of this product (v2020.1 build 0401) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.