FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
152 stars 63 forks source link

Turkish region setting [DNET166] #74

Closed firebird-automations closed 16 years ago

firebird-automations commented 16 years ago

Submitted by: art (art)

Relate to DNET167

Attachments: NETProvider 2.1.0.rar

Dear Sir/Madam

I have been using Firebird 2.1 (Win32), Firebird .Net Data Provider, DDEX Provider for VS2005, VS2008 Team throgh WinXP SP3. I use Turkish Windows. Because of that some error has been while i try to change capital letters to little letters. For example in Turkish we have got capital i (İ) but in English there is no capital i and we also have got little ı (i without dot). Because of that we can't get the same results with Upper, Lower and Compare functions as in English. This situation is explained in helping files in MSDN.

        I edited Firebird \.Net Data Provider but I can't edit DDEX\. I used CultureInfo\.CurrentCulture instead of CultureInfo\.InvariantCulture\. Edition you can solve this problem by not using Turkish comparation  and sorting in this kinds string operation\. If you search "Turkish" word in MSDN documents you can find a lot of examples\. 

        I added a simple file which has some examples about my problem\. 

        Regards\.

Prelectorer TANIŞ Ali Rıza.

KS University / K.Maraş / TURKEY

mailto:alirizatanis@ksu.edu.tr

firebird-automations commented 16 years ago
Modified by: art (art) Attachment: Help\.txt \[ 10920 \]
firebird-automations commented 16 years ago

Commented by: @cincuranet

And how this relates to .NET provider?

firebird-automations commented 16 years ago

Commented by: art (art)

Version 2.1.0 for .NET 2.0 and Version 2.5.0 Alpha 2 for .NET 3.5/2.0.

firebird-automations commented 16 years ago

Commented by: @cincuranet

OK, what does creating upper case and lower case letters with FirebirdClient? The sample you've attached conotains no related code.

firebird-automations commented 16 years ago

Commented by: art (art)

This code lines (line number: 125-142) from FbTableConstrains.cs file in FirebirdClient-2.5.0-Alpha2-src.7z code source.

switch (parsed[6].ToString().ToUpper(CultureInfo.CurrentCulture)) { case "UNIQUE": parsed[3] = "u"; break;

case "PRIMARY KEY":
    parsed\[3\] = "p";
    break;

case "FOREIGN KEY":
    parsed\[3\] = "f";
    break;

case "CHECK":
    parsed\[3\] = "c";
    break;

}

switch (parsed[6].ToString().ToUpper(CultureInfo.CurrentCulture)) This line if used Turkish character in the string has a error. (For example "primary key" not equal "PRIMARY KEY". This action return "PRİMARY KEY".)

"PRIMARY KEY" != "PRİMARY KEY" "PRIMARY KEY" != "PRİMARY KEY" "PRIMARY KEY" != "PRİMARY KEY"

not I. İt's İ.

But

CultureInfo.CurrentCulture != CultureInfo.InvariantCulture CultureInfo.CurrentCulture != CultureInfo.InvariantCulture CultureInfo.CurrentCulture != CultureInfo.InvariantCulture

This is OK.

True code is below.

switch (parsed[6].ToString().ToUpper(CultureInfo.InvariantCulture)) { case "UNIQUE": parsed[3] = "u"; break;

case "PRIMARY KEY":
    parsed\[3\] = "p";
    break;

case "FOREIGN KEY":
    parsed\[3\] = "f";
    break;

case "CHECK":
    parsed\[3\] = "c";
    break;

}

CultureInfo.InvariantCulture is true in all languages.

Examples: "is null" != "IS NULL" (equal "İS NULL")

"alter domain" != "ALTER DOMAIN" (equal "ALTER DOMAİN")

This is OK.

Edited code is attached. Find "ToUpper", and find "ToLower", and find "CultureInfo." including lines in current project.

firebird-automations commented 16 years ago
Modified by: art (art) Attachment: NETProvider 2\.1\.0\.rar \[ 10921 \]
firebird-automations commented 16 years ago
Modified by: @cincuranet Attachment: Help\.txt \[ 10920 \] =\>
firebird-automations commented 16 years ago
Modified by: @cincuranet Version: 2\.5\.0 Alpha 2 \[ 10240 \] Version: 2\.5\.0 Alpha 1 \[ 10230 \]
firebird-automations commented 16 years ago

Commented by: @cincuranet

Finally some useful info.

firebird-automations commented 16 years ago
Modified by: @cincuranet Link: This issue relate to [DNET167](https://github.com/FirebirdSQL/NETProvider/issues?q=DNET167+in%3Atitle) \[ [DNET167](https://github.com/FirebirdSQL/NETProvider/issues?q=DNET167+in%3Atitle) \]
firebird-automations commented 16 years ago

Commented by: art (art)

Please you reading below links.

Find Turkish in the documents.

http://msdn.microsoft.com/en-us/library/ms973919.aspx#stringsinnet20_topic5 http://msdn.microsoft.com/en-us/goglobal/bb688162.aspx

To DDEX is ok.

Below lines from FbDataObjectSupport.xml file.

<\!\-\-
        Defines a type that represents a table column\.
    \-\-\>
<Type name="Domain" defaultSort="Catalog, Schema, Name"\>
  <Concepts\>
    <Concept name="Domain" restrictions="\{Catalog\},\{Schema\},\{Name\}"/\>
  </Concepts\>

  <Identifier\>
    <\!\-\-
      <Part name="Catalog" itemName="domain\_catalog"\>
    \-\-\>
    <Part name="Catalog" itemName="domaIn\_catalog"\>
      <Concepts\>
        <Concept name="Identifier0"/\>
      </Concepts\>
    </Part\>

    <Part name="Schema" itemName="domaIn\_schema"\>
      <Concepts\>
        <Concept name="Identifier1"/\>
      </Concepts\>
    </Part\>

    <Part name="Name" itemName="domaIn\_name"\>
      <Concepts\>
        <Concept name="Identifier2"/\>
      </Concepts\>
    </Part\>
  </Identifier\>

    <\!\-\-
      <Part name="Catalog" itemName="domain\_catalog"\>
    \-\-\>
    <Part name="Catalog" itemName="domaIn\_catalog"\>

This part is very important.

I am changed <Part name="Catalog" itemName="domain_catalog">

itemName="domain_catalog"

CurrentCulture.Upper(itemName) != "DOMAIN_CATALOG" in Turkish region set. CurrentCulture.Upper(itemName) == "DOMAİN_CATALOG" in Turkish region set. This is false. But converting I case in "domain_catalog" this line true Turkish region set. CurrentCulture.Upper("domain_catalog") == "DOMAİN_CATALOG" This Line false. CurrentCulture.Upper("domaIn_catalog") == "DOMAIN_CATALOG" This line true.

Solution: All itemNames in this file is convert uppercase. exam:

Original line <Part name="Catalog" itemName="domain_catalog"> Edited line <Part name="Catalog" itemName="DOMAIN_CATALOG">

This method all times true.

firebird-automations commented 16 years ago

Commented by: art (art)

True Turkish regional set DDEX file.

firebird-automations commented 16 years ago
Modified by: art (art) Attachment: FirebirdSql\.VisualStudio\.DataTools\.dll \[ 10930 \]
firebird-automations commented 16 years ago
Modified by: @cincuranet Attachment: FirebirdSql\.VisualStudio\.DataTools\.dll \[ 10930 \] =\>
firebird-automations commented 16 years ago

Commented by: @cincuranet

Hello,

it should be fixed now in SVN.

Can you please grab sources and test it?

firebird-automations commented 16 years ago
Modified by: @cincuranet status: Open \[ 1 \] =\> Resolved \[ 5 \] resolution: Fixed \[ 1 \] Fix Version: 2\.5\.0\. Alpha 3 \[ 10261 \] Fix Version: 2\.5\.0 \[ 10170 \]
firebird-automations commented 16 years ago

Commented by: art (art)

I have downloaded from SVN. But ı haven't got Entity Framework on my computer. I can't test it.

firebird-automations commented 16 years ago

Commented by: @cincuranet

Just remove ENTITY_FRAMEWORK symbol.

firebird-automations commented 16 years ago

Commented by: art (art)

Thanks. It is OK. I can tested Web App. But I can not test WinForm. Are you editing DDEX ?

firebird-automations commented 16 years ago

Commented by: @cincuranet

No.

firebird-automations commented 15 years ago
Modified by: @cincuranet Fix Version: 2\.5\.0 \[ 10170 \] =\>