Re: [sqlite] how to use c binding and write output in c

2012-04-03 Thread Kees Nuyt
YAN HONG YE  wrote:

> Richard Hipp  wrote:
>
>> On Sun, Apr 1, 2012 at 11:21 PM, Roy Tam  wrote:
>
>> 2012/4/2 YAN HONG YE :
>> > when I run this following code  , the html file encoding changed to
>> GB2312,not utf-8, I don't know why?
>> > system("echo ^ >mm.html");
>> >   system("sqlite3 -html -header foods.db \"select * from dzh where
>> qph15>10;\" >>mm.html");
>> >   system("echo ^ >>mm.html");
>>
>> You're windows user, right?
>> system() in windows will convert all things to System Codepage
>> (CP_ACP), so please use C bindings and write output in C but not using
>> system().
>>
>
>The open-source Fossil  version control system
>used by SQLite contains an implementation of system() that correctly deals
>with UTF8 even on windows systems.  Perhaps the OP can copy some of the
>code from that.  LInk:
>
>http://www.fossil-scm.org/fossil/artifact/70e4b10c0208b3?ln=685-707
>
> But I don't know how to write.

Well, perhaps today you don't know how to write code that uses the
example, but if you take some time to learn it, you may be able to do it
in a few weeks or months.
Or you may want to hire someone who can do it for you.

-- 
Regards,

Kees Nuyt

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] how to use c binding and write output in c

2012-04-03 Thread YAN HONG YE
Date: Mon, 2 Apr 2012 00:37:18 -0400
From: Richard Hipp  wrote:

On Sun, Apr 1, 2012 at 11:21 PM, Roy Tam  wrote:

> 2012/4/2 YAN HONG YE :
> > when I run this following code  , the html file encoding changed to
> GB2312,not utf-8, I don't know why?
> > system("echo ^ >mm.html");
> >   system("sqlite3 -html -header foods.db \"select * from dzh where
> qph15>10;\" >>mm.html");
> >   system("echo ^ >>mm.html");
>
> You're windows user, right?
> system() in windows will convert all things to System Codepage
> (CP_ACP), so please use C bindings and write output in C but not using
> system().
>

The open-source Fossil  version control system
used by SQLite contains an implementation of system() that correctly deals
with UTF8 even on windows systems.  Perhaps the OP can copy some of the
code from that.  LInk:

http://www.fossil-scm.org/fossil/artifact/70e4b10c0208b3?ln=685-707


--
But I don't know how to write  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users