locked
Culture issue on string comparision RRS feed

  • Question

  • Hi,

    We are providing localization support in our application. While testing the application for “Turkish” culture, we are facing issues in character comparisons. For e.g. if I have to match a word ‘Miami’ with ‘miami’ then I am writing the following code

    string strWord="Miami";

    if (strWord.ToLower() == "miami")

    { }

    Above example works fine in “English” culture but when culture of the application is “Turkish” then while converting the ‘Miami’ word in lower cases, it remove the “dot of i” and hence doesn’t returns the proper result.

    We can fix this issue by using “ToLowerInvariant()” instead of “ToLower()” however I have to go to each page and manually make these changes at every place. I have large no of pages in my application because of which it is not an effective way of doing.

    It will be great if some can help me on providing a global fix for this issue. Also it will be helpful if you can let me know if there is more culture related issue with comparison etc.

    Thanks,

    Wednesday, April 23, 2014 12:58 PM