Delphi 2010 Wide functions vs. String functions
Asked Answered
M

2

8

We're currently converting a Delphi 2007 project to Delphi 2010. We were already using Unicode (via WideStrings and TNT Unicode Controls).

I was expecting to replace all Wide functions, e.g. WideUpperCase, with their equivalent, e.g. UpperCase, but they do not work the same way. For example, WideUpperCase works differently from UpperCase. WideUpperCase correctly uppercases Campañas, but UpperCase leaves the ñ in lower case.

Are there any other differences that I should be aware of? e.g. do WideFormat and Format work the same?

Thanks

Monjo answered 23/4, 2010 at 2:10 Comment(0)
Z
9

You should use ToUpper function from Character unit to uppercase unicode strings. Or else you can use AnsiUpperCase if you need to support the common codebase for non-unicode and unicode Delphi versions - AnsiUpperCase is Ansi function for Delphi 2007 and prior, and unicode function for Delphi 2009 and above.

Zouave answered 23/4, 2010 at 2:19 Comment(0)
C
1

The naming is really bad (due to keeping compat with older versions). I suggest you read the cos for each string function you might want to use and check if it works with Unicode or not.

Calton answered 23/4, 2010 at 7:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.