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

Provide ability to suppress localized messages in error stack (or make them to be encoded to required charset, say 'utf8') [CORE6470] #6701

Open
firebird-automations opened this issue Jan 20, 2021 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
file-related-error-messages-in-localized-form.png

I can't understand for what reason FB utilities issue part of error messages in localized form.
Please provide ability either to fully supress such messages or make them be displayed in apropriate encoding, which must be equal to connection charset.

Please look:

C:\HQBWork\1IMPORTANT\QArundaily>chcp
Active code page: 65001

C:\HQBWork\1IMPORTANT\QArundaily>echo set names utf8; create database 'z:\nosuch_disk\no_such_folder\foo.fdb' user sysdba password 'masterkey'; | isql -q 1>isql-stdout.log 2>isql-stderr.log

C:\HQBWork\1IMPORTANT\QArundaily>type isql-stderr.log
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "z".
-Failed to locate host machine.
-The specified name was not found in the hosts file or Domain Name Services.

// here we see all messages in ascii (good).

C:\HQBWork\1IMPORTANT\QArundaily>echo set names utf8; create database 'c:\no_such_folder\foo.fdb' user sysdba password 'masterkey'; | isql -q 1>isql-stdout.log 2>isql-stderr.log

C:\HQBWork\1IMPORTANT\QArundaily>type isql-stderr.log
Statement failed, SQLSTATE = 08001
I/O error during "CreateFile (create)" operation for file "C:\NO_SUCH_FOLDER\FOO.FDB"
-Error while trying to create file
-������� �� ������� ����� ��������� ����.

// here we can not read last line

C:\HQBWork\1IMPORTANT\QArundaily>chcp 1251
Active code page: 1251

C:\HQBWork\1IMPORTANT\QArundaily>type isql-stderr.log
Statement failed, SQLSTATE = 08001
I/O error during "CreateFile (create)" operation for file "C:\NO_SUCH_FOLDER\FOO.FDB"
-Error while trying to create file
-Системе не удается найти указанный путь.

// here we *can* read last line but we have to change code page to that Windows uses.

I can not imagine FB admin who will not be able to translate from english messages related to file/process access. Or at least to use goodle translate.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: file-related-error-messages-in-localized-form.png [ 13541 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

I wonder if this problem occurs in ISQL (decoding it wrong), or if it happens in the server (putting the error message in the wrong encoding in the status vector).

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

It seems to me that it's about all FB console utilities.

C:\FB\40SS>nbackup.exe -N no_such_file
[
PROBLEM ON "attach database".
I/O error during "CreateFile (open)" operation for file "no_such_file"
-Error while trying to open file
-Не удается найти указанный файл. // localized msg for 'file not found', rus
SQLCODE:-902
]

C:\FB\40SS>fbsvcmgr.exe localhost:service_mgr action_backup dbname no_such_file bkp_file c:\temp\foo.fbk
I/O error during "CreateFile (open)" operation for file "no_such_file"
-Error while trying to open file
-Не удается найти указанный файл. // localized msg for 'file not found', rus

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

This problem can not be fully fixed in the current design of status vector.

It's the client that translate a win32 error code to string and client does not have access to intl.

An workaround can be made for when the client charset is utf8.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> An workaround can be made for when the client charset is utf8.

Actually, even this seems not possible as formatting of a status vector is not related to a connection (and does not have a client charset).

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

Shouldn't the status vector simply always use UTF-8?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

No. Every things reported by server must use the attachment connection charset.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> even this seems not possible as formatting of a status vector is not related to a connection (and does not have a client charset).

Is it possible (for server) to supress all non-ascii error messages, or replace them with '?' marks ? (of course, this must be configurable parameter)

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

2 participants