I'm using GetRVDataText to get the text from two variables of type TRVTableCellData. Depending on option settings I want to compare them in either case sensitive or case insensitive fashion, and be able to support unicode characters in the text.
This code works for non-Unicode strings :
if CaseSensitive then
begin //Do case-sensitive compare
if CompareStr(GetRVDataText(PQAURec^.MCFillIn1),GetRVDataText(PMiscRec^.MyAnswer)) = 0 then
Do Stuff
end
else
begin //Do case-insensitive compare
if CompareText(GetRVDataText(PQAURec^.MCFillIn1),GetRVDataText(PMiscRec^.MyAnswer)) = 0 then
Do Stuff
end;
What is the proper approach to be able to handle the text returned from GetRVDataText which can/will include Unicode characters (the control is set to rvuMixed.
Compare Case Sensitive OR Case Insensitive Mixed String?
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Ok, but, as far as I know, capitalizing Unicode text is a tricky task, because the result may depend on the text language (which is unknown)
What's why, I think, the help file for this function states: "The compare operation is controlled by the current locale". So in some cases the results may be different on different computers.
Just FYI.
What's why, I think, the help file for this function states: "The compare operation is controlled by the current locale". So in some cases the results may be different on different computers.
Just FYI.
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact: