The output was UTF8 text in default and CP932 in pb_ascii (which is what my system is set to use in the regional settings when not using unicode)
If you need to force a specific code page different from the user's default then you will need to use WideCharToMultiByte
Does this help at all or do you need to force a code page non standard to the system running the app?
Code: Select all
UseSQLiteDatabase()
Filename$ = "c:\utf.db"
If OpenFile(0, Filename$)
Debug "Database file created"
CloseFile(0)
EndIf
If OpenDatabase(0, Filename$, "", "")
Debug "Connected to PureBasic.sqlite"
If DatabaseUpdate(0, "CREATE TABLE info (test VARCHAR(255));")
Debug "Table created"
EndIf
DatabaseUpdate(0, "insert into info (test) values('日本語')") ;
DatabaseQuery(0, "SELECT * FROM info")
OpenFile(0,"c:\UTFOut2.txt")
While NextDatabaseRow(0)
WriteString(0, GetDatabaseString(0, 0));#PB_Ascii
Wend
CloseFile(0)
EndIf