Re: String.Compare seems to fail when it should not

Ryan Heath <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
On Mon, Sep 8, 2008 at 1:04 PM, Simon Robinson <[email protected]> wrote:

> 1. Check the culture settings that your code is working in. I think that
> override of String.Compare() is culture-dependant, so maybe there's some
> unusual culture that doesn't recognize eg. 'r' and 'R' as being equivalent?

I believe StringComparison.OrdinalIgnoreCase is culture independent
(when it can)?

> 2. Check the actual unicode values of the characters in your strings. Is
> it possible that the 'r' (taking one random character as an example)
> actually isn't an 'r' but is some other unusual unicode character that
> just happens to look like an 'r' when displayed in your default font?

I'll log the unicode values of the strings too, lets see what that
will bring up.

// Ryan

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.