realbasic-plugins
[Top] [All Lists]

Re: text encodings of database strings

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: text encodings of database strings
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Tue, 15 Feb 2005 10:13:41 -0600
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <3396e7e205021507595bf39c1b at mail dot gmail dot com>
At 7:59 AM -0800 2/15/05, Will Leshner wrote:

I'd like to be able to set the text encodings of strings I return to
RecordSets obtained with my Database implementation, but I'm not sure
it can be done. I believe my only opportunity to communicate with the
value of a table field is in the cursorColumnValueFunc callback, but
there I return a char*, not a REALstring.

So, stop doing that. :) You get to define what data type you're returning; you need to return dbTypeREALstring. For example:

        static REALstring strVal = nil;
        if (strVal) REALUnlockString( strVal );
        strVal = NewREALstring( fieldVal.GetString() );
        if (type) *type = dbTypeREALstring;
        if (length) *length = sizeof(REALstring);
        if (value) *value = (Ptr) &strVal;

Best,
- Joe

--
REAL World 2005 - The REALbasic User Conference
March 23-25, 2005, Austin, Texas
<http://www.realsoftware.com/realworld>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>