Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPB flag isc_dpb_utf8_filename don't work [CORE3172] #3546

Open
firebird-automations opened this issue Oct 8, 2010 · 11 comments
Open

DPB flag isc_dpb_utf8_filename don't work [CORE3172] #3546

firebird-automations opened this issue Oct 8, 2010 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

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.

@firebird-automations
Copy link
Collaborator Author

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Duplicates CORE2172.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE2172 [ CORE2172 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @aafemt

status: Closed [ 6 ] => Reopened [ 4 ]

Planning Status: Considered for inclusion

resolution: Duplicate [ 3 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

Testcase for this ticket and (most likely) CORE2172 as well.

@firebird-automations
Copy link
Collaborator Author

Modified by: @aafemt

Attachment: CORE3127.cpp.7z [ 12919 ]

@mikekaganski
Copy link

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?

@aafemt
Copy link
Contributor

aafemt commented Sep 10, 2021

It is faaaar from that simple as shown unicode branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants