Hsqldb table encoding

前端 未结 3 615
清歌不尽
清歌不尽 2021-01-24 07:41

How do I set the character encoding for a specific table? E.g:

CREATE TABLE COMMENTS (
    ID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 0, INCREMENT BY 1)          


        
相关标签:
3条回答
  • 2021-01-24 08:20

    HSQLDB certainly stores all data in Unicode (with the exception of TEXT tables where you have to specify UTF-8). Therefore you don't need to specify a character encoding for normal tables.

    0 讨论(0)
  • 2021-01-24 08:21

    Are you sure that it's encoded as ASCII by default? My reading of it was that it's UTF-8 by default, though I'm open to correction here.

    If it's a TEXT table you'll can specify the encoding for the table

    SET TABLE mytable SOURCE "myfile;encoding=UTF-8"
    
    0 讨论(0)
  • 2021-01-24 08:30

    The problem is that you must convert all rows before import.
    To do this you must export the contents to a file and converter the file into utf-8. Then import it again with utf-8 options.

    MyPHPadmin can import it with utf-8 options, (Remember to check for CHARSET=latin1 / latin1 in the file).

    You can read more about to do it manually her: http://en.gentoo-wiki.com/wiki/Convert_latin1_to_UTF-8_in_MySQL

    0 讨论(0)
提交回复
热议问题