Swedish characters (ÅÄÖ) in path

This is the international (english) support forum for the SQLite Administrator developed and maintained by Orbmu2k.

Moderators: gto, EgonHugeist, Orbmu2k

Locked
CarlG
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 15.03.2007, 10:48

Swedish characters (ÅÄÖ) in path

Post by CarlG »

Hi!

I have just downloaded SQLite Administrator. It looks great. However, it seems to be unable to open databases with Swedish characters (ÅÄÖ, åäö) in the path or filename...

Is this easy to fix?
When trying to open such a DB, SQLite Admin seems to create a new, empty DB with the same name except all Swedish characters are gone...

Regards
Carl Gustafsson
Orbmu2k
SQLite Admin Developer
SQLite Admin Developer
Posts: 38
Joined: 07.12.2005, 07:51
Contact:

Post by Orbmu2k »

At sqlite2 databases i dont see any problems ...

But at Sqlite3 Databases iam also unable to create a database with these chars.

I got:

Code: Select all

library routine called out of sequence
this bug seem so be related by zeoslib
CarlG
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 15.03.2007, 10:48

Post by CarlG »

Is this something that might be fixed in the overseeable future?

Regards
Carl
stadin
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 05.05.2007, 11:16

Post by stadin »

It is related to the Sqlite Version, because since 3.2.5 utf8 is used internally. I had the same problem with german Umlauts in the path. I changed the Open function in ZPlainSqlite3Driver.pas to use utf8 for versions > 3.2.5. Now it works.

function TZSQLite3PlainDriver.Open(const filename: PChar; mode: Integer;
var errmsg: PChar): Psqlite;
var
Result0: Psqlite;
Version: string;
FileNameString: String;
begin
Version := LibVersion;
Result0:= nil;
FileNameString := filename;
if (Version > '3.2.5') then
ZPlainSqLite3.sqlite_open(PAnsiChar(AnsiToUTF8(FileNameString)), Result0)
else
ZPlainSqLite3.sqlite_open(filename, Result0);
Result := Result0;
end;
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

This solution is committed to SVN Testing branch (Rev 246). So this will be included in next Zeoslib release. (Unless somebody says the fix is broken, as I did not test it myself)

Mark
aducom
Zeos Dev Team
Zeos Dev Team
Posts: 67
Joined: 30.08.2005, 13:21

Post by aducom »

Why not:

Code: Select all

function TZSQLite3PlainDriver.Open(const filename: PChar; mode: Integer;
  var errmsg: PChar): Psqlite;
var
  Result0: Psqlite;
begin
 Result0:= nil;

 if (LibVersion > '3.2.5') then
   ZPlainSqLite3.sqlite_open(PAnsiChar(AnsiToUTF8(FileName)), Result0)
 else
   ZPlainSqLite3.sqlite_open(filename, Result0);

  Result := Result0;
end;
??
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

@Aducom
No real reason. I have been thinking about which version to use. I probably choose for readability. When you send me a patch for Sqlite, can you just add this optimization?

Mark
aducom
Zeos Dev Team
Zeos Dev Team
Posts: 67
Joined: 30.08.2005, 13:21

Post by aducom »

ok
Locked