Open firebird-automations opened 14 years ago
Commented by: @asfernandes
It's supposed to work only if the unicode characters are included in the system ANSI codepage.
There is another ticket opened about full support for Unicode.
Commented by: @asfernandes
Duplicates CORE2172.
Commented by: @aafemt
This ticket is not a duplicate because is caused not by lack of Unicode support in engine, but unnesessary recoding of UTF-8 file names into ANSI code page in Y-valve on client side, which completely beats the idea behind isc_dpb_utf8_filename flag.
Commented by: @aafemt
Testcase for this ticket and (most likely) CORE2172 as well.
It looks like the problem is reasonably straightforward to handle by settling on URF-8 on Windows, so that all that ping-pong with ISC_utf8ToSystem
-> ISC_systemToUtf8
in Dispatcher::attachOrCreateDatabase
would be a no-op, and finally, in src/common/os/win32/os_utils.cpp
, the relevant functions would internally convert the UTF-8-encoded octet strings into wchar_t*, and use Windows-specific "wide" API like _wfopen
?
It is faaaar from that simple as shown unicode branch.
Submitted by: Pierre Yager (pierrey)
Duplicates CORE2172
Attachments: CORE-3127.cpp.7z
While trying to implement support to utf8_filename DPB flag into UIB Components we cannot pass any test.
1) I created a database with a system charset filename in either server, then I renamed it to unicode charset using the operating system commands (Rename on Windows, mv on Linux). For instance I choosed this name : привет.fdb
2) I succeded accessing the database on the Linux server using ISQL on both Linux and Windows clients. On Windows client the database name has to be specified in an input file, on Linux client, the filename can be specified either as a command line argument or in an input file but neither allow to specify the connexion string within the ISQL console prompt.
3) On Windows clients, accessing such databases is impossible. I gave a look at the Firebird engine core and It seems that the algorithm to resolve file names is : read filename; if not isc_dpb_utf8filename then ISC_SystemToUTF8(filename); ISC_UTF8ToSystem(filename); Open(filename)
So the filename is always accessed using an ANSI filename throught ANSI API on Windows. On Linux SystemToUTF8/UTF8ToSystem functions are void and fopen((char*)) is UTF8 compliant.
4) Within the Delphi (2010, Full Unicode) client using the latest UIB Components I tried different compositions between adding the utf8_filename flag or not, transcoding the database name to utf8 or not...
Results :
* utf8_filename flag : ON - Filename : UTF8 : I get this error : Cannot transliterate character between character sets / Connection error / Error Code: 652 * utf8_filename flag : OFF - Filename : UTF8 : I get this error : I/O error during "open" operation for file "/db/├É┬┐├æÔé¼├É┬©├É┬▓├É┬Á├æÔÇÜ.fdb" Error while trying to open file No such file or directory Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements Error Code: 24
* utf8_filename flag : ON - Filename : Ansi : the filename is sent as ?????.fdb because there is no russian chars in the Win1252 charset * utf8_filename flag : OFF - Filename : Ansi : same as above.