I found some problems about Chinese characters

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by YaoMing Huang
Avatar
We are a Taiwanese software company. We bought SynctaxEditor control from you one week ago. We are going to develop some Chinese applications with this control. But we found a problem in this control.The problem is that the SynctaxEditor always show me double Chinese charactors while I use Chinese input method on it.

Take something for example, if I input single Chinese word "中" on the Editor control, it shows me "中中". And if I input two words "中文", it shows me "中中文文". Is this a bug ?

I caught the events when I use Chinese input method on the editor. and captured the picture for you to reference.

http://www.intellischool.com.tw/twochar.jpg

I wish you could solve the problem or tell me how to avoid the problem as soon as possible. Thank you very much.

Comments (9)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It appears that our KeyDown and KeyPress logic are both firing the KeyTyping/ed event sequence for this input method, which would be a bug.

As I am not familiar with Chinese input methods, can you specify exactly how you type these characters on a keyboard? Like do you hold Control, and press a letter key or something similar?


Actipro Software Support

Posted 14 years ago by YaoMing Huang
Avatar
I don't know how to describe all the processes that I input the Chinese characters on SyntaxEditor with Chinese input methods.
But I've tried to log the windows message with "Microsoft SPY++" to explain what I did when I used the Chinese input methods on the control.
It might be helpful for you to solve this problem.

1~4 Control Focused
5~9 Input "C" character
10~14 Input "I" character
15~19 Press space
20~28 Change input method to Chinese
29~33 Input "C" character
34~37 Input "I" character
38~50 Press space
51~54 Control Lost Focus
<00001> 0001079A S WM_IME_SETCONTEXT fSet:1 (LONG)iShow:C000000F
<00002> 0001079A S WM_IME_NOTIFY dwCommand:00000002 dwData:00000000
<00003> 0001079A R WM_IME_NOTIFY
<00004> 0001079A R WM_IME_SETCONTEXT
<00005> 0001079A P WM_KEYDOWN nVirtKey:'C' cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00006> 0001079A P WM_CHAR chCharCode:'0043' (67) cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00007> 0001079A S WM_IME_NOTIFY dwCommand:0000000B dwData:00000000
<00008> 0001079A R WM_IME_NOTIFY
<00009> 0001079A P WM_KEYUP nVirtKey:'C' cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00010> 0001079A P WM_KEYDOWN nVirtKey:'I' cRepeat:1 ScanCode:17 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00011> 0001079A P WM_CHAR chCharCode:'0049' (73) cRepeat:1 ScanCode:17 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00012> 0001079A S WM_IME_NOTIFY dwCommand:0000000B dwData:00000000
<00013> 0001079A R WM_IME_NOTIFY
<00014> 0001079A P WM_KEYUP nVirtKey:'I' cRepeat:1 ScanCode:17 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00015> 0001079A P WM_KEYDOWN nVirtKey:VK_SPACE cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00016> 0001079A P WM_CHAR chCharCode:'0020' (32) cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00017> 0001079A S WM_IME_NOTIFY dwCommand:0000000B dwData:00000000
<00018> 0001079A R WM_IME_NOTIFY
<00019> 0001079A P WM_KEYUP nVirtKey:VK_SPACE cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00020> 0001079A P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00021> 0001079A S WM_IME_NOTIFY dwCommand:00000001 dwData:00000000
<00022> 0001079A R WM_IME_NOTIFY
<00023> 0001079A S WM_IME_NOTIFY dwCommand:00000002 dwData:00000000
<00024> 0001079A R WM_IME_NOTIFY
<00025> 0001079A S WM_IME_NOTIFY dwCommand:00000007 dwData:00000000
<00026> 0001079A R WM_IME_NOTIFY
<00027> 0001079A P WM_KEYUP nVirtKey:VK_SPACE cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00028> 0001079A P WM_KEYUP nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00029> 0001079A P WM_KEYDOWN nVirtKey:VK_PROCESSKEY cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00030> 0001079A P WM_IME_STARTCOMPOSITION
<00031> 0001079A P WM_IME_COMPOSITION chDBCS:FF23 fFlags:01BF
<00032> 0001079A P WM_IME_NOTIFY dwCommand:00000005 dwData:00000001
<00033> 0001079A P WM_KEYUP nVirtKey:'C' cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00034> 0001079A P WM_KEYDOWN nVirtKey:VK_PROCESSKEY cRepeat:1 ScanCode:17 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00035> 0001079A P WM_IME_COMPOSITION chDBCS:FF29 fFlags:01BF
<00036> 0001079A P WM_IME_NOTIFY dwCommand:00000003 dwData:00000001
<00037> 0001079A P WM_KEYUP nVirtKey:'I' cRepeat:1 ScanCode:17 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00038> 0001079A P WM_KEYDOWN nVirtKey:VK_PROCESSKEY cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00039> 0001079A P WM_IME_COMPOSITION chDBCS:0000 fFlags:1FBF
<00040> 0001079A S WM_IME_CHAR chCharCode:'00A4A4A4' (42148) cRepeat:1 ScanCode:00
<00041> 0001079A S WM_IME_NOTIFY dwCommand:0000000B dwData:00000000
<00042> 0001079A R WM_IME_NOTIFY
<00043> 0001079A R WM_IME_CHAR
<00044> 0001079A P WM_IME_NOTIFY dwCommand:00000004 dwData:00000001
<00045> 0001079A P WM_IME_ENDCOMPOSITION
<00046> 0001079A P WM_CHAR chCharCode:'.' (164) (lead) cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00047> 0001079A P WM_CHAR chCharCode:'00A400A4' (164) (trail) cRepeat:1 ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00048> 0001079A S WM_IME_NOTIFY dwCommand:0000000B dwData:00000000
<00049> 0001079A R WM_IME_NOTIFY
<00050> 0001079A P WM_KEYUP nVirtKey:VK_SPACE cRepeat:1 ScanCode:39 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
<00051> 0001079A S WM_IME_SETCONTEXT fSet:0 (LONG)iShow:C000000F
<00052> 0001079A S WM_IME_NOTIFY dwCommand:00000001 dwData:00000000
<00053> 0001079A R WM_IME_NOTIFY
<00054> 0001079A R WM_IME_SETCONTEXT
[Modified at 11/23/2005 02:19 AM]
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Could you send us an email so that we can work with you on how to duplicate this here? And if that's not possible with a US Windows XP setup and normal US keyboard, maybe we can work back and forth with you over email to help resolve this. Thanks!


Actipro Software Support

Posted 14 years ago by YaoMing Huang
Avatar
Please contact my using the following email:

yaoming.huang@gmail.com.tw.

You can use Chinese Input Method if you install Multi-Language Pack for Windows XP. There are many Chinese Input Methods available when you install the language pack. Regardless of the Chinese Input Method you choose, the problem still occurs. Thanks for your help.

Best regards,

Yaoming Huang
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Before I contact you further on this, do you have the latest build 3.1.0202? We made a fix to an issue with KeyTyping for German/Swiss keyboards in that build and I'm curious if it fixes your issue as well.


Actipro Software Support

Posted 14 years ago by YaoMing Huang
Avatar
The lastest build 3.1.0202 was released on 11/15/2005, and I downloaded the SyntaxEditor control on 11/19/2005.And I checked the version of the SyntaxEditor that I used is 3.1.202.0 (I checked it in VS.net 2005 ). Is that elder than the version 3.1.0202 ?

Anyway ,thank you for your reply.
Posted 14 years ago by YaoMing Huang
Avatar
Hi, do I need to give you further information for you to debug the program or you are still looking for the cause of this problem? We were planning to use the editor control in our project, we need to know if this problem is fixable and when will it be fixed. Only when have that information, can we determine the schedule of our project, it is currently on the "critical path". Please let us know as soon as possible. Thanks for your help!!
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi there, we had sent you an email over a week ago to work with you more on this but never got a reply. Can you send us an email and we will reply with what we sent you last week? Thanks!


Actipro Software Support

Posted 14 years ago by YaoMing Huang
Avatar
I am sorry for missing your email because there is something wrong with my email.
Could you send me the agent to the following email address ?

software.support@m2k.com.tw

The following code is what my temporary solution is.
using System;
using ActiproSoftware.SyntaxEditor;

namespace ServiceDevHelper
{
    class iSchoolSyntaxEditor:SyntaxEditor
    {
        private bool CancelNext = false;
        protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e)
        {
            if (CancelNext)
            {
                e.Handled = true;
                CancelNext = false;
                return;
            }

            if (System.Text.Encoding.UTF8.GetByteCount(new char[] { e.KeyChar }) >= 2)
                CancelNext = true;

            base.OnKeyPress(e);
        }
    }
}
The latest build of this product (v2020.1 build 0400) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.