At 02:03 PM 10/1/2012, Christian Hjortmar wrote:
List!
I would like to give credit to a man from Gothenburg, Sweden. He called by
phone and told me how to resolve my sorting problem. Helpfiles coming with
Rbase regarding sorting with international characters seem to partly emanate
from DOS times. The ASCII table is from DOS time and the numbers for letters
are not correct for Windows XP and later. Try to
make a table with two columns
(letter and (ichar(letter))). You will now see the characternumbers. In the
COLLATE section of rbengine.cfg you have number pairs. The first number is
the character number and the second number shows in what order that letter
is sorted. So in my case åä is sorted together with a and ö with o. Now I
want those three letter to end up after z that have the number 122 in the US
alphabet. So I give them numbers 124, 126 and 129. Then the helpfiles are
correct. One must have a rbengine.cfg file together with the database. A
corrected *.cfg file ie. Then as the helpfile and list has told me do a PACK
"database" ALL WITH USER CASE. Then the corrections are saved within the
database. The ASCII table in the helpfiles is old I would say.
Thank you all.
/Christian
Christian,
Here is something else, very important and more technical, you may want to
know related to sorting of international characters and expansion table in
R:BASE configuration file.
When testing the similar scenario on our end, the ä character is actually in
the database with a code of 228, not 132. The code 132 would be used if the
old OEM fonts were being used, but with ANSI fonts, the code is 228, so the
expansion table does nothing for it. To do proper testing we had this line
in our config file:
EXPAND 228 97 101
This was in place of this line:
EXPAND 132 97 101
In addition, the current code used for string compares does not use the
expansion tables at all. This was all configured for the older versions
of R:BASE until April 2008. Before this time when the engine was built
with Borland, the compare routine for equal comparisons was written in
assembler.
In testing older versions with Borland built engines it looks like this
has been this way for a very long time. We were able to verify that version
6.5 did use the expansion table on equal comparisons, but not on contains.
The use of the expansion table for contains has not been in active code
since around 1993. All the newer versions do not use the expansion table
on equal comparisons, nor on contains.
We feel that the expansion tables should be used on equal comparisons,
since they used to work. The upcoming update of R:BASE eXtreme 9.5 will
supports the main string comparison routine used in the R:BASE engine.
Since the contains compares (and wild cards too) have not used expansion
tables for nearly 18 years, making a change now could mess up some people's
applications. We will have to leave that functionality alone. The contains
does use the CASEP table when case sensitivity is off, in this database 228
is mapped to 65 which is capital A. This means that contains 'ä' works just
like contains 'A' when case is off.
Very Best R:egards,
Razzak.
www.rbase.com
www.facebook.com/rbase