Vinamra Bhantagar
Vinamra Bhantagar

Reputation: 147

Undeclared identifier TEncoding delphi7

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??

Upvotes: 2

Views: 9775

Answers (2)

Remy Lebeau
Remy Lebeau

Reputation: 595402

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

Upvotes: 8

Andreas Rejbrand
Andreas Rejbrand

Reputation: 108929

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

Upvotes: 7

Related Questions