On Mon, 03 Nov 2008, Szak�ts Viktor wrote: Hi Viktor,
> Per thread of course. I think this is very important. > Right now we have multiple different things controlled > by this one setting, and I have to risk an index corruption I think that you still do not understand that _THEY_ always will be controlled by this setting and you will only introduce additional risk for data corruption by enabling unintentional translation. > if I want to make an UPPER() call using a different CP. Nothing will be changed by adding default RDD CP because all expressions will be still evaluated with HVM CP. You will only enable possibly danger translation. > Or, the CP has to be saved/set/restored when such thing > occurs, or the program has to be modified to force CP on > table opening. At least if I'm not missing anything. You missed the most important thing that all expressions have to be executed using current HVM CP because they can use data with national characters or call UDFs which uses data with national characters or even compare data with different WAs which uses internally different encoding and need to be unified before comparison. The CODEPAGE clause makes only one thing here. It enables automatic translation between HVM and table encoding when field is accessed/assign. It can be used only between the same languages using the same collation rules and only different encoding. >> I always set HVM codepage by HB_SETCODEPAGE() to my source code >> encoding which is also encoding of my database files and use CODEPAGE >> in RDD only when I want to import/export data with different then >> default encoding. > This is good as long as your user don't want to switch > to a different UI language, and f.e. you want to use > an UPPER() call on a UI string. Or you have any other > program parts which temporarily needs a different CP. Set and restore HVM CP only for this operation and be sure that other code will not be executed inside. But it has nothing to default RDD CP. You will still have the same problem. > If you mix those parts with db operations, this is real > trouble. > Most of these could IMO be solved with such defaulting > setting as 'hb_rddInfo( RDDI_CODEPAGE, "EN" )'. It will not be solved. In the moment when you are changing HVM CP you are changing the behavior of string comparison operations what will effect all existing RDD expressions when they will be evaluated. Default RDD CP does not change anything here. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour