Page 1 of 1

how to deal with chinese!

Posted: Sun May 28, 2006 3:19 pm
by alexe
I am a chinese developer! recently I work on a project that deal with the software skype! one function is record the chat message from the coversation window .I get the handle of the chat window,and using sendmessage(hwnd ,wm_gettext,buf),get the text of the chat window!when I write the content of buf in a file,I find a strange problem, that the English words in the text are geted ok! all r be geted! but the Chinese words are not,we just get the half of the length of that sentence! such as
in the text, if in one sentence there is four chinese words, only half of that ,two words is geted! why! I cann't solve it! frome the internet,I find that chat window is made from Trichview control! So I come here for help!how will I do to solve it?pls tell me! my mail:alexe_chen@163.com,skye id is alexe2008 :P

Posted: Tue May 30, 2006 1:09 pm
by Sergey Tkachenko
Sorry, we cannot say exactly why it happens. The Skype developers may use customized version of TRichView with their own implementation of WM_GETTEXT.
(History:
Processing of this message was implemented in TRichView 1.9.6.
Starting from v1.9.10.2, processing of this message was disabled for Delphi 2005 and 2006, because it conflicts with their default implementation. I do not know which version of TRichView and Delphi Skype uses)

Posted: Wed May 31, 2006 8:04 am
by ilgam
Skype devs use 1.9.14.1.

Posted: Thu Jun 01, 2006 1:07 pm
by Sergey Tkachenko
So, if they use an older version of Delphi (not 2005 or 2006), and they did not modify TRichView code, WM_GETTEXT should be processed by TRichView.
On this message, TRichView returns text using GetTextRange function from RVLinear.pas. This function converts Unicode text to ANSI (DBCS), using the language of style charset, or (if charsetr is DEFAULT_CHARSET)RVStyle.DefCodePage.