Hello,
My Path is: "J:\TestInstall\Neuer Ordner\undÜ ü ßß ö Ö ż łćó ss"
This Path contains characters where are not codet in the Ansi Character Set.
But the SQLite DLL can this characters. I have change one line in the code, just ist work better:
src\plain\ZPlainSqLiteDriver.pas
function TZSQLite3PlainDriver.Open(const filename: PChar; mode: Integer;
var errmsg: PChar): Psqlite;
var
Result0: Psqlite;
Version: string;
FileNameString: String;
begin
Result0:= nil;
Version := LibVersion;
FileNameString := filename;
{$IFNDEF VER130}
if (Version > '3.2.5') then
{$IFDEF FPC}
ZPlainSqLite3.sqlite_open(FileNameString, Result0) // Lazarus nuzt direkt UTL-8 so auch SQLite.dll
{$ELSE}
ZPlainSqLite3.sqlite_open(PAnsiChar(AnsiToUTF8(FileNameString)), Result0)
{$ENDIF}
else
{$ENDIF}
ZPlainSqLite3.sqlite_open(filename, Result0);
Result := Result0;
end;
Please include it into your main sources.
Best Regards Markus.
Cannot open SQLite Database with UTF-8 Filename (Lazarus)
Moderators: gto, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Markus,
This is strange. Why am I getting this error line?
I'm using compiler version 2.7.1, so it can be a bug in fpc, but indeed, we're passing a string variable to a OChar parameter, so that's not nice anyway. Should I suround this by PAnsiChar()?
Mark
This is strange. Why am I getting this error line?
on lineZPlainSqLiteDriver.pas(840,47) Error: Incompatible types: got "AnsiString" expected "PChar"
Code: Select all
ZPlainSqLite3.sqlite_open(FileNameString, Result0) // Lazarus nuzt direkt UTL-8 so auch SQLite.dll
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
OK. See the difference...
In your post :
Mark
In your post :
In your code:ZPlainSqLite3.sqlite_open(FileNameString, Result0) // Lazarus nuzt direkt UTL-8 so auch SQLite.dll
I'll test when current test run is over and probably commit in half an hour to 6.6-patches.ZPlainSqLite3.sqlite_open(PAnsiChar(FileNameString), Result0) // Lazarus nuzt direkt UTL-8 so auch SQLite.dll
Mark