how to deal with chinese!

General TRichView support forum. Please post your questions here
Post Reply
alexe
Posts: 1
Joined: Sun May 28, 2006 5:39 am

how to deal with chinese!

Post 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
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
ilgam
Posts: 16
Joined: Sun Aug 28, 2005 5:04 am

Post by ilgam »

Skype devs use 1.9.14.1.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply