WPCubed Product Support

Korean text is doubled

We use the WPReporter in an application, and allow the end users to edit the text. When a user Korea enters Korean text (symbols to me) they are getting the characters repeated. They appear twice immediately on entry, and are stored as unicode characters twice in the data file. If you then hit backspace, it will remove a single character (that may happen after it is saved, not sure).

Are there any known issues with Unicode and Korean keyboards?

My full question set is this, in case it reveals anything additional you may ask. (Also, I'm about to disappear on holiday, but will be around intermittently before new year.)

Okay, I can see the content of the file now, and it appears that the
characters (forgive my language ignorance if they are not characters) are
indeed in the file twice.

Could you tell me more about how you enter such characters please?
-> Enter the Korean characters just beside the English titles by putting the
English/Korean toggle key into Korean at the keyboard.

Do you have a keyboard with them?
-> Yes, there is a English/Korean toggle key with the keyboard.

What do you see on the screen when you enter a character - a single
character or two?
-> I see two characters of all characters input beside the last character.

What is the first point at which you see the double?
-> The first character of my input.

Can you open the template again and delete one of the duplicated characters?
-> Yes, I can open the template again and delete one of the duplicated
characters.

Does it come back again?
-> It comes back again as it was. That is, it comes back with duplicated
characters when it wasn't corrected, and it comes back with a single
character when it was corrected.

I hope that this is something simple - I don't want to have to buy a Korean keyboard to work it out!

Many thanks, Matthew

#1 ♥ 0
10k Views 2 users read 4 min
support

Hi,

The reason for this can be the IME code.

If you comment out the [$define IMEINPUT} in unit WPCtrMemo hopefully this works.

Julian

#2 ♥ 0

Hi, I'm back from holiday, and will try this change soon. Many thanks.

#3 ♥ 0

I'll let you know if this fixes it, and if so, if I can work out why it might.

But what would be really useful is if some more of the $DEFINES like this were in an INC file. Right now I can't add warnings to my code to verify that my change is made. I wanted to output a message to warn that the option was enabled, which presumably it will be if I update and forget to make the change again. The define doesn't get to be in my code, so I can't test and output a warning if it is defined. If it was in an INC file, then I could include the INC myself and thus make the test work. I hope this is something you can consider for the future. Thanks!

Matthew

#4 ♥ 0

Okay, results back from the Korean customer say that without that definition, no Korean characters can be input at all. I will revert, and see if I can get time to work out if there is an error in the IME code.

#5 ♥ 0

Further reading of the URL in your code shows that the sample tests for GCS_RESULTSTR which is not done in the WPTools version. Presumably this is what makes a repeat. I'll add the test and let you know.

#6 ♥ 0

Okay, I got a report back from the customer and my fix works. Could you please review this and let me know when it is in the release code please?

This is the code - I added the IF at the beginning.

procedure TWPCustomRtfEdit.WMIMEComposition(var Message: TMessage);
var IMEContext: HIMC;
  l, i: Integer;
  s: WideString;
  ss: string;
begin
  if ((Message.lParam and GCS_RESULTSTR) = 0) then
  begin  // MJ Added this section
	inherited; // We 'eat' the WM_IME_CHAR in WndProc()!
	exit;
  end;
  IMEContext := ImmGetContext(Handle);

In essence, the code is ignored unless it is the final result.

#7 ♥ 0
support

Hi,

if ((Message.lParam and GCS_RESULTSTR) = 0) then
begin // MJ Added this section
inherited; // We 'eat' the WM_IME_CHAR in WndProc()!
exit;
end;

looks good. Thanks. It is not in V5.36

Julian

#9 ♥ 0

@wpsupport:
looks good. Thanks. It is not in V5.36

Thanks - I'm in no hurry for it, but it is good to know it will be in the next update after this. Have a good holiday!

Matthew

#10 ♥ 0
This category is archived. No new posts are possible.