Page 1 of 1

Unable to display Big5 Chinese characters.

Posted: Fri Jul 26, 2024 7:24 am
by richard-service
Dear Antonio, Mr.RAO

Unable to display Chinese characters. But this is not Unicode. Very simple Big5 code into DBF file.

Code: Select all | Expand

HB_LangSelect( "zh" )
HB_SetCodePage( "UTF8" )
HB_CDPSELECT( "UTF8" )

Fw_SetUnicode( .T. )

REDEFINE XBROWSE oBrwV ID 105 OF oDlgSS ;
 HEADERS "病歷號","姓名","治療日","復健師","評估","簡單"+CHR(13)+CHR(10)+"簡單","簡單"+CHR(13)+CHR(10)+"中度","中度"+CHR(13)+CHR(10)+"中度","中度"+CHR(13)+CHR(10)+"複雜","複雜","評估","簡單","中度","中度"+CHR(13)+CHR(10)+"複雜","複雜","評估","簡單","中度","複雜","中度"+CHR(13)+CHR(10)+"複雜"   ;
 COLSIZES 65,65,75,70,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50 ;
  FIELDS WREHCDAT->NUM,;
  HB_TRANSLATE(ALLTRIM(WREHCDAT->NAME),'UTF8','BIG5') ,;

 
These Chinese word only Big5 code. not Unicode.
Why not show Chinese Word.

Image

These Chinese word only Big5 code. not Unicode.
But need to use this function to show word.

Code: Select all | Expand

HB_TRANSLATE(ALLTRIM(WREHCDAT->NAME),'UTF8','BIG5')
 
Image

XBrowse need to add this function HB_TRANSLATE(ALLTRIM(WREHCDAT->NAME),'UTF8','BIG5')
But Use TCBrowse working fine. Not add this function HB_TRANSLATE(ALLTRIM(WREHCDAT->NAME),'UTF8','BIG5')
No problem.

Re: Unable to display Big5 Chinese characters.

Posted: Sun Jul 28, 2024 3:45 pm
by nageswaragunupudi

Code: Select all | Expand

HB_TRANLATE( cStr, "UTF8", "BIG5" )
Translates cStr from UTF8 to BIG5. Right?

Can you please show here translation of the word GOOD in both utf8 and big5 ?

Re: Unable to display Big5 Chinese characters.

Posted: Mon Jul 29, 2024 3:16 am
by richard-service
nageswaragunupudi wrote:

Code: Select all | Expand

HB_TRANLATE( cStr, "UTF8", "BIG5" )
Translates cStr from UTF8 to BIG5. Right?

Can you please show here translation of the word GOOD in both utf8 and big5 ?
Dear Mr.RAO
I think FUNCTION HB_TRANSLATE() is not the point. Because Chinese word "蘇謙" Exists in BIG5 code and UNICODE/UTF8 code.
I use TCBrowse show them no problem. Not use HB_TRANSLATE() function.
Print Say "蘇謙" not work. Appear Garbled characters.

Re: Unable to display Big5 Chinese characters.

Posted: Mon Jul 29, 2024 8:37 am
by nageswaragunupudi
Because Chinese word "蘇謙" Exists in BIG5 code and UNICODE/UTF8 code.
Tried this small test to understand the issue.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oWnd, oBrw
   local cText :=  "蘇謙" 

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-80
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )
   oWnd:bPainted :=  { || oWnd:SayText( cText, { 0,0,100,nil} ) }
 
   @ 100,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oWnd ;
      DATASOURCE { { cText, cText }, { cText, cText } } ;
      LINES NOBORDER
   oBrw:CreateFromCode()

   oWnd:nHeight := 500
   ACTIVATE WINDOW oWnd CENTERED

return nil
 
Image

Is this wrong?

Re: Unable to display Big5 Chinese characters.

Posted: Wed Jul 31, 2024 5:33 am
by richard-service
nageswaragunupudi wrote:
Because Chinese word "蘇謙" Exists in BIG5 code and UNICODE/UTF8 code.
Tried this small test to understand the issue.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oWnd, oBrw
   local cText :=  "蘇謙" 

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-80
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )
   oWnd:bPainted :=  { || oWnd:SayText( cText, { 0,0,100,nil} ) }
 
   @ 100,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oWnd ;
      DATASOURCE { { cText, cText }, { cText, cText } } ;
      LINES NOBORDER
   oBrw:CreateFromCode()

   oWnd:nHeight := 500
   ACTIVATE WINDOW oWnd CENTERED

return nil
 
Image

Is this wrong?
This times. I try to convert my old Fivewin code. Old Fivewin library 2002.11 version. Only WBrowse and TCBrowse and ListBox. Display "蘇謙" no problem.
Now, I test two harbour and xharbour with FWH2402. Harbour problem I already display sample code. xHarbour I use TCBrowse no problem. below picture
Image

Re: Unable to display Big5 Chinese characters.

Posted: Wed Jul 31, 2024 4:08 pm
by nageswaragunupudi
In my sample, this is shown correctly in XBrowse.