At 2011-03-02 09:17:48,"Igor Tandetnik" <itandet...@mvps.org> wrote:
>On 3/1/2011 8:05 PM, 陈强 wrote: >> At 2011-03-01 20:56:49,"Igor Tandetnik"<itandet...@mvps.org> wrote: >> >>> 陈强<snk32...@163.com> wrote: >>>> Why is the Chinese i Selected from SQLIte.exe and jdbc is not different. >>>> The Chinese from JDBC(rs.getString(index)) is normal but >>>> the Chinese from Sqlite.exe (Select data) is Garbled, my environment as >>>> list: >>> >>> Console window doesn't know UTF-8. The strings are fine, but the console >>> can't render them correctly. >> >> The charSet of the String insert into db is GBK, the console should show >> GBK String correctly. > >I'd double-check that if I were you. That would be highly unusual. How >do you put those strings into the database? If with a Java program, >realize that Java always represents all strings in UTF-16. > >I stronly doubt a simple rs.getString(index) would have worked correctly >if the string weren't stored in UTF-16 or UTF-8 in the database. SQLite >certainly wouldn't automatically convert from GBK to UTF-16 that Java >requires. > > >Show the output of this query, when run in sqlite.exe: > >select hex(MyStringField) from MyTable limit 10; > >Substitute your actual table and column names for MyTable and >MyStringField, of course. >-- >Igor Tandetnik > Hi Thanks a lot for your help! I'am a javaBeginner. I will send the output of the query as soon as possible, because it's not in my pc. But if i want to make the gbk console show String correctly, what should i do? i know if i put the gbk bytes into db, the String will be show correctly, but the column type will be blob, it's not the result i wanna. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users