Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » console + sql + unicode or utf
console + sql + unicode or utf [message #32346] Tue, 10 May 2011 15:18 Go to next message
begnur is currently offline  begnur
Messages: 6
Registered: May 2011
Location: Turkmenistan
Promising Member
I have this code and I cant read non US characters and also pass a character which is not ascci..
for example sql : select * from kelimeler where tur = "şık"

can you help me where is my problem (or what am I doing wrong..)

CONSOLE_APP_MAIN
{
	Sqlite3Session db;
	if(!db.Open(ConfigFile("sozluk.db"))) {
		Cout() << "Veritabanı oluşturulamıyor\n";
		return;
	}
	
#ifdef _DEBUG
	db.SetTrace();
#endif
	
	SQL = db;
	SQL.ClearError();
	
	Sql sql;
	sql.Execute("select tur from kelimeler where ing =\"hi\" limit(10)");
	//for(int i = 0; i < sql.GetColumns(); i++)
	//	Cout() << sql.GetColumnInfo(i).name << "\n";
	while(sql.Fetch())
		Cout() << sql[0] << "\n";
	Cout() << sql.GetColumns() << "\n";
	Cout() << L"Türkçe Karakterler şüğşlk\n";
}


by the way my databases is defined as follows

BEGIN TRANSACTION;
CREATE TABLE kelimeler (tur VarChar(100) NOT NULL, ing VarChar(100) NOT NULL);
INSERT INTO "kelimeler" VALUES('ne','what');
INSERT INTO "kelimeler" VALUES('bir','a');
INSERT INTO "kelimeler" VALUES('bir parça','a bar of');
INSERT INTO "kelimeler" VALUES('bir parça','a bit');
.
.
.
INSERT INTO "kelimeler" VALUES('genç erişkin','young adult');
CREATE INDEX idx_tur ON kelimeler(tur);
CREATE INDEX idx_ing ON kelimeler(ing);
COMMIT;
Re: console + sql + unicode or utf [message #32352 is a reply to message #32346] Wed, 11 May 2011 08:50 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
Put this line to the start of your program:
	SetDefaultCharset(CHARSET_UTF8);
Re: console + sql + unicode or utf [message #33927 is a reply to message #32346] Mon, 26 September 2011 21:35 Go to previous message
begnur is currently offline  begnur
Messages: 6
Registered: May 2011
Location: Turkmenistan
Promising Member
spasibo bolshoe tebe zlost Smile
Previous Topic: Format of Select statement inside Insert..??
Next Topic: SqlMassinsert
Goto Forum:
  


Current Time: Thu Jun 13 18:23:38 CEST 2024

Total time taken to generate the page: 0.01084 seconds