FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 15.08 UNICODE support: Beginnings
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
FWH 15.08 UNICODE support: Beginnings
Posted: Sun Sep 13, 2015 06:25 PM
FWH 15.08 provides limited support for Unicode. This is to get some idea of what is possible in this version.

Sample xbrowse:


Please excuse me if there are any mistakes or blunders in the translation. I just adopted Google's translation for demonstration purposes.

Sample of Report generated by XBrowse:


Sample of export to Excel:


How I created the above data: I do not know three of the above languages. First I created a DBF with all columns but data only in English field. Then I opened Google Translate page and sought translations of the English words in different languages. I copied the translated words and pasted into the XBrowse.

As you know, if the cells of xBrowse are made editable and oBrw:lCanPaste is set to .T., we can copy text from any external source and paste into xbrowse cells and the pasted data is automatically saved in the data source. From FWH15.08 it is possible to copy/paste Unicode text also.

What is the present level of Unicode support now:

On windows many common controls like Say, Buttons, BtnBmp. Buttonbars, Menus, Browses, etc support display of Unicode text. On dialogs only xbrowse, btnbmp can support unicode.

Editing is still not supported. While the controls display the unicode text correctly for the first time, subsequent modification of text may not work as expected.

With the support and help from all, we can expect our colleagues in the FWH team will soon provide us with a fully functional version.

By the way, this is a small and simple program I put together to create the DBF with the above data. Any one can try this program to create a DBF with different languages. (Need to wait for release of revised build)
Code (fw): Select all Collapse
#include "FiveWin.Ch"

REQUEST DBFCDX

function Main()

   local cDbf  := "UTF8_02.DBF"
   local oFont

    RDDSETDEFAULT( "DBFCDX" )
   FW_SetUnicode( .t. )

   if ! File( cDBF ); CreateDBF( cDBF ); endif
   USE ( cDBF ) NEW ALIAS UTF SHARED

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-16 BOLD
   XBROWSER "UTF" TITLE FWVERSION + " UNICODE" FASTEDIT ;
      SETUP ( oBrw:lCanPaste := .t., oBrw:Urdu:nDataStrAlign := AL_RIGHT, ;
      oBrw:nHeadStrAligns := AL_CENTER, oBrw:SetFont( oFont ), oBrw:nWidths := 100 )
   RELEASE FONT oFont

return (0)

static function CreateDBF( cDBF )

   local aCols    := { { "ENGLISH", 'C', 10, 0 } }

   AEval( { "CHINESE", "KOREAN", "HINDI", "TELUGU", "URDU" }, ;
      { |c| AAdd( aCols, { c, 'C', 20, 0 } ) } )

   DBCREATE( cDBF, aCols, "DBFCDX", .t., "UTF" )
   FW_ArrayToDBF( { {"Apple"}, {"Ball"}, {"Cat"}, {"Doll"}, {"Engine"}, {"Fruit"}, {"Good"}, {"High"} }, "ENGLISH" )
   CLOSE UTF

return nil

How xbrowse makes complex tasks simple?
Regards



G. N. Rao.

Hyderabad, India
Posts: 195
Joined: Sun Jul 22, 2012 07:01 PM
Re: FWH 15.08 UNICODE support: Beginnings
Posted: Tue Sep 15, 2015 10:55 PM

With build 2 this sample code is not working for me at all, editing any of the fields then doing a copy/paste of a unicode character displays only double question marks. If the app is closed then restarted, which uses the previously created dbf where presumably the ?? was saved, the application will crash immediately.

I'm seeing a lot of other spurious crashes in my code now as well, all appear to bexbrowse related, in places in my code that were completely solid until the 15.08 release (either the original or the 2nd release, but the 2nd release is less stable than the first).

I have neither time nor inclination to debug this, just sharing my experience. I've just removed 15.08 from my system and rolled back to 15.07, there are too many weird crashes to deal with. I'll try again when you folks get this correct and stable.

This is on MSVC 2013, both 32 and 64 bit.

Robb

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: FWH 15.08 UNICODE support: Beginnings
Posted: Wed Sep 16, 2015 08:17 AM

Robb,

We do appreciate if you could provide us some examples to test here where it crashes.

We are working hard on unicode support and we really need all your feedback, many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion