fw_SetUnicode()

fw_SetUnicode()

Postby marzio » Sun Apr 16, 2017 1:25 pm

hi at all,
when i activate unicode with fw_SetUnicode(.t.) all the gets of my program (dbase fields, MsgGet(), etc.) are in insert mode and i am not able to set overwrite mode.
is there a way to activate overwrite mode?
thanks
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: fw_SetUnicode()

Postby nageswaragunupudi » Mon Apr 17, 2017 2:23 pm

You may set FW_SetUnicode( .T. ) at the very beginning in the Main() function if you want to make a Unicode application.

In a Unicode application GETs of any variable other than character type behave the same way as in a pure ANSI application. Behavior of GETs of character variables is effected by CLAUSE CHRGRP

@ r,c GET ........... CHRGRP CHR_ANSI / CHR_ANY / CHR_WIDE.

In a pure ANSI application ( where FW_SetUnicode() is not set to .T. ) CHRGRP defaults to CHR_ANSI.
In a Unicode application, CHRGRP defaults to CHR_ANY.
Even in a Unicode application, if CHRGRP is specified as CHR_ANSI, that GET behaves exactly like in a normal ANSI application, i.e., insert/overstrike modes work and all picture clauses work, but input is restricted to ANSI characters and Unicode characters are rejected.

When CHRGRP is CHR_ANY or CHR_WIDE, Unicode input is accepted but this has limitations like overstrike does not work, picture formats (expect @!) do not work.

So, if you want some Gets to work exactly like in a normal ANSI application, you need to add a clause CHRGRP CHR_ANSI
If you want Unicode input then you need to live with the limitations of Unicode character Get behavior.

Just for information: CHR_ANY restricts the input to the number of bytes in the original Get variable, where as CHR_WIDE restricts input to number of characters in the Get variable. This is the only difference between CHR_ANY and CHR_WIDE.

I am curious to know, why do you want to use FW_Unicode( .T. ), unless you are making an application for use in Eastern countries? I do not see any use of it in Europe. Your reply can help me to assist you better.
Regards

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

Re: fw_SetUnicode()

Postby marzio » Mon Apr 17, 2017 8:57 pm

Nages,
many thanks for your informations!
i am trying the news in fwh, I'm trying to understand this topic (unicode) quite complex.
Anyway i am interested to use im my programs languages like russian, rumenian, french.
thanks for any help.
marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: fw_SetUnicode()

Postby nageswaragunupudi » Tue Apr 18, 2017 3:25 am

i am trying the news in fwh, I'm trying to understand this topic (unicode) quite complex.

Pleae go ahead testing. As you go on you will find Unicode is not really complex. It is as simple as a normal ANSI program but has the capability to handle Unicode text. Well you need to keep in mind the behavior of GETs. That is the only difference.
Anyway i am interested to use im my programs languages like russian, rumenian, french.

For French, you do not need Unicode.

What I understand from you is that your application will be mostly an ANSI application with only a few modules / screens handling Unicode text. Am I right?

We provided the Unicode feature for an application that mostly deals with Unicode text and occassionally deals with ANSI text. For this reason, all Gets default to Unicode.

In your case (and similar applications) probably it is more convenient if the Gets default to ANSI and only where you need Unicode input, you can specifically enable by specifying CHRGRP CHR_ANY / CHR_WIDE.

We shall provide a global switch for this in our next version.
Regards

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

Re: fw_SetUnicode()

Postby marzio » Tue Apr 18, 2017 7:11 am

What I understand from you is that your application will be mostly an ANSI application with only a few modules / screens handling Unicode text. Am I right?

yes, my applications are mostly ANSI with few modules / screens handling Unicode text.

In your case (and similar applications) probably it is more convenient if the Gets default to ANSI and only where you need Unicode input, you can specifically enable by specifying CHRGRP CHR_ANY / CHR_WIDE.

ok, this is that i will make.

We shall provide a global switch for this in our next version.

is it possible in browse file to have columns with UNICODE and column with ANSI ?

many thanks,
marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: fw_SetUnicode()

Postby nageswaragunupudi » Wed Apr 26, 2017 2:27 am

is it possible in browse file to have columns with UNICODE and column with ANSI ?

Yes, possible.

From version FWH17.04, you can set classdata TGet():lDefaultANSI := .t. at the beginning of the application after FW_SetUnicode( .t. ). With this setting, all Gets default to ANSI. Only for the Gets you require Unicode input, you can add the clause CHRGRP CHR_ANY or CHRGRP CHR_WIDE as required.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 5 guests