Unable to display Big5 Chinese characters.

Unable to display Big5 Chinese characters.

Postby richard-service » Fri Jul 26, 2024 7:24 am

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 view

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 view

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.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 801
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unable to display Big5 Chinese characters.

Postby nageswaragunupudi » Sun Jul 28, 2024 3:45 pm

Code: Select all  Expand view
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 ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unable to display Big5 Chinese characters.

Postby richard-service » Mon Jul 29, 2024 3:16 am

nageswaragunupudi wrote:
Code: Select all  Expand view
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.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 801
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unable to display Big5 Chinese characters.

Postby nageswaragunupudi » Mon Jul 29, 2024 8:37 am

Because Chinese word "蘇謙" Exists in BIG5 code and UNICODE/UTF8 code.

Tried this small test to understand the issue.
Code: Select all  Expand view
#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?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unable to display Big5 Chinese characters.

Postby richard-service » Wed Jul 31, 2024 5:33 am

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 view
#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
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 801
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: Unable to display Big5 Chinese characters.

Postby nageswaragunupudi » Wed Jul 31, 2024 4:08 pm

In my sample, this is shown correctly in XBrowse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10468
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests