Re: invalid code page error on a connect

Giganews Newsgroups
Subject: Re: invalid code page error on a connect
Posted by:  Remy Lebeau (re…@lebeausoftware.org)
Date: Thu, 9 Feb 2012

Mike wrote:

> For one particular client however the Connect fails due to the error Invalid
Code Page.

Is that client using Windows XPe, by chance?  XPe does not have codepage
20127 installed by default.  That is the codepage that Embarcadero's SysUtils.TEncoding.ASCII
property uses in D2010 (in later Delphi versions, several codepages are attempted
until one is found).

> I cannot find any way to change the codepage/charset/encoding on the connect
itself.

If Connect() is called when no TIdIOHandler component is assigned yet, it
creates an internal TIdIOHandlerStack.  During the base class TIdIOHandler's
construction, its DefStringEncoding property gets initialized to TIdTextEncoding.ASCII
(which maps to TEncoding.ASCII).  If codepage 20127 is not installed, you
get the error.

This issue was addressed in a later Indy 10 release by re-writting Indy's
ASCII support to no longer be dependant on any codepages at all.

--
Remy Lebeau (Indy Team)

Replies

None

In response to

invalid code page error on a connect posted by Mike Dumble on Thu, 9 Feb 2012