On Sunday, March 30, 2003, at 04:04 PM, Olivier Scherler wrote:
rb doesn't know the encoding when you read from the database.
when you read a database cursor, define its encoding as UTF8 before
you
hand it to the editfield.
How do I do that? There are no properties or methods related to
encoding in
DatabaseCursor, RecordSet, REALDatabase or Database.
Moreover, since the DataControl is (autonotsomagically) handing the
data to the
EditField, I have no control over the process, unless I write a class
that
duplicates DataControl's behaviour*. Being used to C++, Java and
Objective C,
I'd subclass DataControl, but since there's no ReadFormDB- or
PopulateFields-like methods to override, I have the hands tied in the
back.
Furthermore, considering RB wrote the database, I would expect it to
be able to
read back from it without me having to tell it how it encoded data. I'd
understand having to be careful with an external database like mySQL,
but in no
way should it require manual conversion. A property should be set,
period.
Strings occur in many places throughout RB, and it appears from the
release notes that RS is steadily working its way through and adding
support for text encoding; you may notice that the latest release adds
encoding support to the BinaryStream class. I'd expect that as long as
the field data is created using Rb controls and passed around by them,
the strings should begin life encoded as UTF-8 and remain that way.
An alternative is to write your own DataControl.
Charles Yeomans
---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>
Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>
Subscribe to the digest:
<mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.
|