realbasic-plugins
[Top] [All Lists]

Re: Unknown encodings

To: realbasic-plugins at lists dot realsoftware dot com
Subject: Re: Unknown encodings
From: "Theodore H.Smith" <delete at elfdata dot com>
Date: Mon, 20 Dec 2004 18:58:25 +0000
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <20041220180046 dot 990325EEF9D at lists dot realsoftware dot com>
Thanks Jon, that should do the trick. (At least I assume it does, because I'm sure you've tested it by passing nil.)

By the way, can you typedef those functions pointers. That would make it look much nicer. I can do it myself, but I'm just making a suggestion because I don't like seeing messy code.

Along these lines, here's something I've done to allow you to define a
string to nil:

static REALstring REALStringDefineEncoding( REALstring inString,
REALobject newEncoding )
{
        static REALstring (*fp)(REALstring, REALobject) = NULL;
        
        if (!fp) {
                fp = (REALstring (*)(REALstring, 
REALobject))REALLoadGlobalMethod(
nil, "DefineEncoding( s as String, enc as TextEncoding ) as String" );
        }
        
        if (fp) {
                REALstring out = fp( inString, newEncoding );
                REALUnlockString( inString );
                return out;
        }
        
        return inString;
}

_______________________________________________
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>