On Fri, 30 Jul 2004, Bertrand Mansion wrote:

>Hi,
>
>How difficult would it be to have both UTF-8 and ISO-8859-1 supported in
>the same library (2.8.15) ? By looking quickly at the sources, it seems
>to be just a matter of changing the functions likeFunc(), globFunc(),
>lengthFunc() and substrFunc(). They could use a flag in order to call the
>code required by the specified encoding.


The problem is that the encoding isn't stored with the data, hence the
library must be configured to assume one or the other.

As the two are mutually incompatible, you're probably better off with
UTF-8 encoding and converting strings yourself. I always compile SQLite v2
with UTF-8 encoding, as all the characters in ISO-8859-1 can be
represented in UTF-8 (I believe. i18n is not my area of expertise.)


>
>In my case, this is needed as I can't figure out in advance which version
>of the library the user wants to use. But my application lets the user
>specify in which encodings the inputs are.


Why not compile and bundle SQLite with your application? You have full
control then.


>
>Is this the way to go or am I missing something ?
>
>Thanks in advance,
>
>Bertrand Mansion
>Mamasam
>

-- 
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

Reply via email to