I guess that most Delphi developers understand the conversion between AnsiString and UnicodeString/WideString, but do you know what will exactly happen when converting an AnsiChar to a WideChar, or vice versa? Especially when we often see these kind of assignment statements: aWideChar := WideChar(anAnsiChar); or anAnsiChar := AnsiChar(aWideChar); Dig it!

I guess that most Delphi developers understand the conversion between AnsiString and UnicodeString/WideString, but do you know what will exactly happen when converting an AnsiChar to a WideChar, or vice versa? Especially when we often see these kind of assignment statements:  aWideChar := WideChar(anAnsiChar); or anAnsiChar := AnsiChar(aWideChar); Dig it!

Comments

  1. I was hoping that by now we would have only one string type, unicode...

    ReplyDelete
  2. Dorin Duminica I prefer it this way tbh, also backwards compatibility is important.

    ReplyDelete
  3. Frédéric Hannes I think backwards compatibility is overrated and needs to die, it only brings trouble...

    ReplyDelete

Post a Comment