2

Hi i want to use TEncoding to convert Tbytes to utf7 but when i use TEncoding delphi gives following error.

Undeclared identifier: 'TEncoding'

i am using delphi 7.

what to do??

2 Answers2

8

The SysUtils.TEncoding class is not available in D7. Use the Win32 API MultiByteToWideChar() and WideCharToMultiByte() functions instead, specifying CP_UTF7 as the codepage.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • This one is correct Vinamra. Either fix your question, delete it, or accept this answer. I still think you're confused and you want UTF8, not UTF7. – Warren P Sep 22 '11 at 14:24
7

TEncoding was introduced in Delphi 2009. You should upgrade to a newer version of Delphi, such as XE.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384