What is the difference between ToUpperInvariant () and ToUpper (new CultureInfo ("en-US", false))

I live in Turkey and I need to use the key in my program. I had to use ToUpper (new CultureInfo ("en-US", false)) instead of ToUpper (), because this function behaves differently on computers configured for Turkish culture (see the figure below). Then I saw that there is also a function of the culture invariant: ToUpperInvariant ().

I searched, but I could not find any information on the differences between these functions. Is there any difference at all?

enter image description here enter image description here

source: http://www.moserware.com/2008/02/does-your-code-pass-turkey-test.html

+4
source share
1 answer

ToUpper() ToUpper(CultureInfo.CurrentCulture), ToUpperInvariant() ToUpper(CultureInfo.InvariantCulture), , .

, , - CultureInfo.InvariantCulture , ( ..), , ToUpper(CultureInfo.CurrentCulture) , , .

CultureInfo.InvariantCulture , , , en-US ( ).

ToUpper - , . ( ) ToUpperInvariant() char, :

lc    en-US     Invariant
==    =====     =========

µ     Μ         µ
ı     I         ı
ſ     S         ſ
Dž     DŽ         Dž
Lj     LJ         Lj
Nj     NJ         Nj
Dz     DZ         Dz
ͅ      Ι         ͅ  //  ͅͅͅͅͅͅͅthis one lives in the 4th dimension. 
ς     Σ         ς
ϐ     Β         ϐ
ϑ     Θ         ϑ
ϕ     Φ         ϕ
ϖ     Π         ϖ
ϰ     Κ         ϰ
ϱ     Ρ         ϱ
ϵ     Ε         ϵ
ẛ     Ṡ         ẛ
ι     Ι         ι
+4

Source: https://habr.com/ru/post/1695108/


All Articles