-1

When I try to compare English symbols like this:

int SomeFunction(System::String^ eng) {
  if(eng[0] == 'q') { return 0; }
  else { return -1; }
}

all works great. But I can't do the same with ua or rus symbols. So how can I compare them?

thor
  • 21,418
  • 31
  • 87
  • 173
  • 1
    What do you mean you "can't"? Compile error? Runtime error? No errors but the comparison always returns `false`? Can you give an example of a character that doesn't work for you? – David Yaw May 05 '16 at 17:43
  • Possible duplicate of [How can I perform a Unicode aware character by character comparison?](http://stackoverflow.com/questions/27229589/how-can-i-perform-a-unicode-aware-character-by-character-comparison) – Adriano Repetti May 05 '16 at 21:16
  • @David Yaw , yes, it always returns a false. Example is "д" or "щ" – Egor Olezhkin May 05 '16 at 21:19

1 Answers1

-1

This works for me (the file has to be "advanced" saved as Unicode):

int main(array<System::String ^> ^args)
{
    Console::WriteLine(L"Hello World");
    if (args[0][0] == L'Ж') { return 1; }
    return 0;
}
Vlad Feinstein
  • 10,960
  • 1
  • 12
  • 27