Re: TIdMessage.SaveToFile: Assertion with Charset = 'iso-8859-15'

Giganews Newsgroups
Subject: Re: TIdMessage.SaveToFile: Assertion with Charset = 'iso-8859-15'
Posted by:  Remy Lebeau \(Indy Team\) (
Date: Thu, 5 Mar 2009

"Joe" <speci…> wrote in message

> When issuing msg.SaveToFile with msg.Charset = 'iso-8859-15' I
> get an Assertion Exception in IdGlobalProtocols, line 3298. With
> 'iso-8859-1' there is no such assertion exception, but Euro-Signs
> are no longer available in the text.

That is because the Euro sign does not exist in ISO-8859-1.  You could use
UTF-8 instead, though.

> Maybee iso-8859-15 is not yet fully implemented in
> TidMessage.SavetoFile of the current Indy build?
> How to fix - any idea?

Indy's charset handling is dependant on the lookup tables in IdCharsets.pas.
Those tables are very large, and there are a lot of charsets (including
ISO-8859-15) that do not have codepage values associated with them yet.

For your immediate bug fix, you can edit the IdCharsetCodePages array in
IdCharsets.pas to assign codepage 28605 to the two array entries that
coorespond to ISO-8859-15 (they are commented so you'll know which ones they
are). As long as your OS has codepage 28605 installed, Indy will be able to
encode and decode ISO-8859-15.

Remy Lebeau (Indy Team)


In response to

TIdMessage.SaveToFile: Assertion with Charset = 'iso-8859-15' posted by Joe on Fri, 06 Mar 2009