Copy & paste Chinese (or Japanese) will be ???

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Dong JIA
Version: 4.0.0237
Platform: Services
Environment: Windows XP (32-bit)
Avatar
Actipro Syntax Editor is very very poor in internationalization and localization.

When I copy Chinese (or Japanese) from Notepad to Actipro Syntax Editor, all characters become "???".
And if I input Chinese or Japanese, all characters will be duplicated.

According to the second bug, you said it is a bug for MS(http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=1694#6055). BUT, Notepad is OK, RichEditControl is OK, and Visual studio is OK, too!

All great products should support internationalization and localization. BUT I have to say that the product using Actipro Syntax Editor can not be a great product because of lacking internationalization and localization.

It is time for Actipro to decide whether to support internationalization and localization seriously!

Dong JIA

Comments (5)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Dong JIA,

When I paste Japanese characters from any other source (such as Notepad or Internet Explorer)
into SyntaxEditor then all the characters render appropriately. I just tested this now on a
test machine running XP Pro with East Asian Language support activated. I ran Internet Explorer,
went to a Japanese site, copied some text, pasted it in Notepad, ran our SyntaxEditor sample
application, and pasted the Japanese text directly in. I could see all the glyphs fine.
I pasted other text directly from IE into the sample application as well.

If you are seeing differently then perhaps the text you are copying is not proper Unicode and
is some sort of other code page format. SyntaxEditor will support any Unicode text in its editing
area as long as the operating system has the proper language files installed.

As for the other bug with duplicate input, that is in fact a Microsoft bug in .NET. We spent a
long time on that in the past and if you try that simple example posted in the other forum topic
that contains the source code for a simple Control with an OnKeyPress override, you can see the
Microsoft bug occur. It has nothing to do with our code. Clearly, Control.OnKeyPress is flawed
when it comes to asian input.

It doesn't happen in those other applications you mentioned because none of them are written in .NET.
They all are C++ applications where this works properly. And the .NET frameword TextBox and RichTextBox
controls are simply wrappers of existing Win32 code, so their C++ Win32 message handlers process
all the key input. Therefore they don't have this issue either.

I even googled this issue and found someone else who tried the same thing. Read the first google
post here. One problem that control author describes is
"character double (when he wrote 2 character, he got twice the same)",
which is the same thing we have demonstrated in our code post in the other topic.

Since .NET tells us that two characters were typed instead of one, we are fed bad input.
Thus you as an end user see bad output.

We do take internationalization seriously in SyntaxEditor. We have written a lot of code to support
IME input and support Unicode characters. This second issue of duplicate input is not something
that we can resolve in our code though since it is Microsoft's code that has the bug.

The only way I can think of to workaround the problem is the possibly ignore a Unicode character if it
was typed within a certain timeframe of the last character and is the same character. Perhaps
that would help with this issue. It's not elegant but based on our tests there doesn't seem to be
anything else we could do. If you want to try to find a better solution or see if you can think of
something we didn't try, I encourage you to implement the simple code sample in the other post and
find a way to get that working without the duplicate input in the OnKeyPress method. Otherwise,
let us know what you think of this possible workaround idea and whether you think it would work.
We'd be happy to do anything to get this working properly and it has been very frustrating for us
that .NET does not handle this correctly.


Actipro Software Support

Posted 12 years ago by Jared Phelps
Avatar
I have zero knowledge of internationalization and this is probably stupid, but just out of curiousity, have you tried overriding the wndproc to detect the keypress event instead of using the .NET onkeypress?

-Jared
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We have considered that but if you use Reflector to look at the Control code, Microsoft has a lot of complex code that kicks in for key processing which we probably shouldn't bypass.

However we have great news! We did some more playing with things and believe we were able to find a workaround for the bug. :) This will appear in the next maintenance release.


Actipro Software Support

Posted 12 years ago by Dong JIA
Avatar
Hi support,

It is a really good news for me that you will fix the duplicated character bug. My question is that we will ship our product in next January and it is code-freezing now. Is there a way for me to replace the current version of dll with a small patch in customer machine? If yes, we will not block for it. And when your patch is availiable, we will ask customer to upgrade your product only.

I know you have full supports for UNICODE. But how about DBCS (Double-Byte character sets)? Is there a plan to support it?

Thanks for your quick reponse and good news. :)

Best regards,
Dong JIA
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Send us an e-mail and we can make a preview build of the next maintenance release.

Unfortunately we don't have any experience with DBCS but if you would be willing to work with us on requirements for it via e-mail, we can try and add whatever you need if possible.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) 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.