Hi All
assume it's something related to accented letters into CLIPBOARD.
You can use this function:
*---------------------------------------------------------------------------------------
Function StrToUtf8( cOriginal )
*---------------------------------------------------------------------------------------
LOCAL c := HB_STRTOUTF8( cOriginal, "UTF8")
LOCAL cFinal := UTF16TOUTF8( strToWide( c ) )
return cFinal
1) The function : StrToUtf8( takes as input a cOriginal string (probably in local or ANSI encoding).
2) HB_STRTOUTF8() is a Harbour function that converts a string from a source code page
(the current runtime code page) to UTF-8.
Here, the second parameter, "UTF8," indicates the destination.
Result: c is a UTF-8 string, but still handled as a normal Harbour CHARACTER.
3) strToWide( c ) takes the UTF-8 string and converts it to a wide string (UTF-16).
UTF16TOUTF8() converts that wide string back to a clean UTF-8.
It's essentially a two-step process: UTF-8 → UTF-16 → UTF-8.
This normalizes the string, eliminating code page ambiguities or non-standard characters.
to modify the toexcel method in Xbrowse
do while nRow <= ( nDataRows + 1 ) .and. lContinue
if ! Empty( cText )
cText += CRLF
endif
cText += ::ClpRow( .t., aCols )
// lContinue := ( ::Skip( 1 ) == 1 )
lContinue := nRow < ( nDataRows + 1 ) .and. ( ::Skip( 1 ) == 1 )
nRow ++
if Len( cText ) > 16000
::oClp:SetText( StrToUtf8( cText ) ) <--------------------------------------------------------
oSheet:Cells( nPasteRow, 1 ):Select()
oSheet:Paste()
::oClp:Clear()
cText := ""
nPasteRow := nRow
endif
If ( nRow - 2 ) % nStep == 0
if Eval( bProgress, nRow - 2, nDataRows ) == .f.
Exit
endif
SysRefresh()
endif
enddo
if ! Empty( cText )
::oClp:SetText( StrToUtf8( cText ) ) <----------------------------------------------------
oSheet:Cells( nPasteRow, 1 ):Select()
oSheet:Paste()
::oClp:Clear()
endif
Eval( bProgress, nDataRows, nDataRows )
SysRefresh()
...
TIA