in testget.prg I need to paste
Code: Select all
RED TEA 华语/華語
But If I paste it into Notepad, it works fine.
Code: Select all
RED TEA 华语/華語
I make sample EXE.ukservice wrote:Antonio,
in testget.prg I need to paste
It shows RED TEA?????Code: Select all
RED TEA 华语/華語
But If I paste it into Notepad, it works fine.
Very good! I didn't thought of such an easy way to test itukservice wrote:Antonio,
in testget.prg I need to paste
It shows RED TEA?????Code: Select all
RED TEA 华语/華語
But If I paste it into Notepad, it works fine.
Antonio Linares wrote:My first try has been to modify FWH Clipboard object to properly retrieve the unicode text, and it is working fine:
But what I have found is that if we convert the unicode text to ansi code, and then back to unicode, the unicode text does not recover its original format:
MsgInfo( AnsiToWide( WideToAnsi( cUnicodeText ) ) ) <> cUnicodeText
I have also tried with Harbour hb_mbtowc() and hb_wctomb() with no success.
Richard, could you please test the AnsiToWide( WideToAnsi( ... ) ) test and see if you get the original unicode string ? thanks
Code: Select all
Function TestUnicode()
Local cUnicodeText := "鱻"
MsgInfo( AnsiToWide( WideToAnsi( cUnicodeText ) ) )
RETURN NIL
Code: Select all
#include "FiveWin.ch"
Function TestUnicode()
Local cUnicodeText := "RED TEA 华语/華語"
MsgInfoU( cUnicodeText )
RETURN NIL
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( MSGINFOU )
{
MessageBoxW( GetActiveWindow(), ( WCHAR * ) hb_parc( 1 ), L"Information", 0x40 );
}
#pragma ENDDUMP
Code: Select all
function Main()
local cUnicodeText := GetStr()
MsgInfoU( cUnicodeText )
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( MSGINFOU )
{
MessageBoxW( GetActiveWindow(), ( WCHAR * ) hb_parc( 1 ), L"Information", 0x40 );
}
HB_FUNC( GETSTR )
{
hb_retclen( ( char * ) L"RED TEA 华语/華語", 26 );
}
#pragma ENDDUMP
Code: Select all
request HB_CODEPAGE_UTF8
request HB_CODEPAGE_UTF16LE
function Main()
local cUnicodeText := "RED TEA 华语/華語"
MsgInfoU( hb_translate( cUnicodeText, 'UTF8', 'UTF16LE' ) )
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( MSGINFOU )
{
MessageBoxW( GetActiveWindow(), ( WCHAR * ) hb_parc( 1 ), L"Information", 0x40 );
}
#pragma ENDDUMP
Sounds great.Antonio Linares wrote:Richard,
We are working on it. We already implemented support for unicode in the clipboard