Martin Pfeifle <[EMAIL PROTECTED]> wrote:
> Dear all,
> in an upcoming project, it is required to store all integer 
> values as little endian instead of big endian (don't ask why).
> Nevertheless, I would like to use SQLite in that project.
> What do we have to change in the sqlite library, 
> if we store the integers as little endian.
> I came across some functions in B-tree.c and pager.c.
> 
> In B-tree.c
> /* Read or write a two- and four-byte big-endian integer values.*/
> get2byte,
> get4byte,
> put2byte,
> put4byte 
> /* pager.c*/
> ** All values are stored on disk as big-endian.
> */
> read32bits,
> write32bits
>  
> Is that enough.

I think so.  Big-endian numbers have the nice property that
memcmp() compares positive integers in numerical order.  I
don't think we are using that property anywhere, but I might
be mistaken.  So if you do come up with a little-endian version
of SQLite, you will want to test it very carefully.

> Another question, what do we have to change if we would
> also store the utf-chars as little endian?

PRAGMA encoding=utf-16le;

The "le" at the end is the important part.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to