On Sun, 06 Dec 2009, [email protected] wrote:

Hi,

> 2009-12-06 19:59 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
>   * src/vm/set.c
>   * src/rdd/dbcmd.c
>   * include/set.ch
>   * include/hbset.h
>     + Added support for SET( _SET_DBCODEPAGE ). This will set the
>       default codepage for RDD operation. It affects following
>       functions and everything which is based on them:
>          DBUSEAREA()
>          DBCREATE()
>          HB_DBCREATETEMP()
>          __DBOPENSDF()

This setting should be moved from above functions to hb_rddOpenTable(),
hb_rddCreateTable and hb_rddCreateTableTemp() or you should update
other code which should respect it.
Personally I prefer to moving it to above functions because in such
case it will work also for existing code without updating each function
which may call above functions directly or indirectly.
It will also fix few places in current core code which now do not
respect above setting yet, i.e. some versions of APPEND FROM / COPY TO.
I guess that you chose above functions because they set default value
for shared/exclusive mode using _SET_EXCLUSIVE but this set is used
to control different things and I do not think it's necessary to
replicate the position of this set for other things.

>       IOW every function which accepts current "dirty" Harbour
>       extension <cCodePage>.

I do not see anything "dirty" in writing code like:

   USE table CODEPAGE "PLISO"

instead of:

   LOCAL cPrecCP
   [...]
   cPrevCP := Set( _SET_DBCODEPAGE, "PLISO" )
   USE table
   Set( _SET_DBCODEPAGE, cPrevCP )

and for sure I will prefer the 1-st version against the second one.

>       This new SET() is useful if someone wants to use a different 
>       than app codepage in tables, without modifying every above
>       calls to pass the db CP as extra parameter (plus maintaining 
>       this global setting in app code).

With this I can agree and I think that in some cases it may be useful.
Anyhow all users should not forget that enabling any automatic code page
translation it's possible for tables containing text data only. Using
codepage translation for standard Clipper DBF tables used to store
binary data directly in table or in memo files will corrupt this data
so it should be used very carefully when user exactly knows what he
does and what it stored in used tables.

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to