Issue Details (XML | Word | Printable)

Key: DNET-741
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Eugene Leontev
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

WIN1251 support in Firebird .net provider 5.8.0.0

Created: 18/Mar/17 06:18 AM   Updated: 28/Mar/17 05:20 AM
Component/s: ADO.NET Provider
Affects Version/s: 5.8.0.0
Fix Version/s: None

Issue Links:
Relate
 


 Description  « Hide
I got this exception after update firebird .net provider from 5.1.0.0 to 5.8.0.0

"I/O error during \"CreateFile (open)\" operation for file \"F:\\Рабочая\\Р'Р"\\March 2016\\MyDb.IB\"\r\nError while trying to open file"

Where connection string is :

server type=Default;
data source=localhost;
port number=3050;
initial catalog=\"F:\\Рабочая\\БД\\March 2016\\MyDb.IB\";
user id=SYSDBA;
password=masterkey;
dialect=3;character
set=WIN1251;
client library=;
connection lifetime=0;
pooling=True;
min pool size=0;
max pool size=50"

With 5.1.0.0 it works fine.

UPD: I've made some tests and I've found out that problem starts from 5.6.0.0 version

UPD#2 I've just copied the FireBird.net provider project from git (and added it to my proj instead nuget package) and got this stack trace while debugging:

"in FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse response)
 in D:\\WokSpace\\C#\\WorkSpace\\FireBirdNEtProvider\\Provider\\src\\FirebirdSql.Data.FirebirdClient\\Client\\Managed\\Version10\\GdsDatabase.cs:line 565\r\n
 in FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse()
 in D:\\WokSpace\\C#\\WorkSpace\\FireBirdNEtProvider\\Provider\\src\\FirebirdSql.Data.FirebirdClient\\Client\\Managed\\Version10\\GdsDatabase.cs:line 597\r\n
 in FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadGenericResponse()
 in D:\\WokSpace\\C#\\WorkSpace\\FireBirdNEtProvider\\Provider\\src\\FirebirdSql.Data.FirebirdClient\\Client\\Managed\\Version10\\GdsDatabase.cs:line 605\r\n
 in FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.Attach(DatabaseParameterBuffer dpb, String dataSource, Int32 port, String database)
 in D:\\WokSpace\\C#\\WorkSpace\\FireBirdNEtProvider\\Provider\\src\\FirebirdSql.Data.FirebirdClient\\Client\\Managed\\Version10\\GdsDatabase.cs:line 180\r\n
 in FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect() in D:\\WokSpace\\C#\\WorkSpace\\FireBirdNEtProvider\\Provider\\src\\FirebirdSql.Data.FirebirdClient\\FirebirdClient\\FbConnectionInternal.cs:line 167"

UPD #3 Finally I've found the roots of the problem - in this commit https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/commit/5b890f4bdadea919519b6102704ba8d711548e68#diff-b52a00de646c3dae032e10698d6b1460 Jiri Cincura has changed this line:

XdrStream.WriteBuffer(Encoding.Default.GetBytes(database))
to
XdrStream.WriteBuffer(Encoding.UTF8.GetBytes(database));

So now if I return an encoding back to Default - it works fine like it was in 5.1.0.0 version.

And so if I understand correctly - it is not a bug it is a new requirement that is not documented anywhere. Need some explanation please.



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order

Jiri Cincura added a comment - 19/Mar/17 02:26 PM
What Firebird version are you using? Is it at least protocol 12? Then the isc_dpb_utf8_filename should kick in.

Eugene Leontev added a comment - 19/Mar/17 10:33 PM
I'm using Firebird 1.5.6(Win32 Build). But I have no problems to connect to any database with whatever path (including cyrillic symbols) through IBExpert (and as I've said already - I have no problems with .net provider ver 5.1.0.0 ) so I don't think that is some firebird issue.

Jiri Cincura added a comment - 20/Mar/17 06:14 AM
Try it with 2.5 or 3.0, these are currently supported versions. Of course you can stay on 5.1 as you did with 1.5 Firebird.

Or you can use only ASCII symbols in path, because that's what Firebird expects anyway. It reads it using ANSI, so it works with other characters only if the server and client OS use same charset, which is lucky coincidence. Also the Default encoding on newer versions of .NET (Core) defaults to UTF8 anyway. So we're back to the square one.


Eugene Leontev added a comment - 20/Mar/17 08:26 AM
Great thanks for your explanation and help, Jiri. I decided to use 5.5.0.0 (it works fine too like 5.1.0.0) because I can't upgrade database with which I work now to firebird 3.0. I think this issue can be closed.

Jiri Cincura added a comment - 20/Mar/17 04:11 PM
OK. I'll close the ticket now. If you feel like testing it later, let me know the result.

Eugene Leontev added a comment - 20/Mar/17 10:40 PM
I"ve tested it with firebird 3.0 - it works fine.