in testget.prg I need to paste
- Code: Select all Expand view
- RED TEA 华语/華語
It shows RED TEA?????
But If I paste it into Notepad, it works fine.
RED TEA 华语/華語
ukservice wrote:Antonio,
in testget.prg I need to paste
- Code: Select all Expand view
RED TEA 华语/華語
It shows RED TEA?????
But If I paste it into Notepad, it works fine.
ukservice wrote:Antonio,
in testget.prg I need to paste
- Code: Select all Expand view
RED TEA 华语/華語
It shows 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
Function TestUnicode()
Local cUnicodeText := "鱻"
MsgInfo( AnsiToWide( WideToAnsi( cUnicodeText ) ) )
RETURN NIL
#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
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
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
Antonio Linares wrote:Richard,
We are working on it. We already implemented support for unicode in the clipboard
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 54 guests