[sword-devel] SWBasicFilter::addEsccapeSubstitute
Helmer Krämer
sword-devel@crosswire.org
Thu, 7 Mar 2002 09:11:08 +0100
This is a multi-part message in MIME format.
--Multipart_Thu__7_Mar_2002_09:11:08_+0100_08287448
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
On Wed, 6 Mar 2002 23:56:48 +0100
Joachim Ansorg <jansorg@gmx.de> wrote:
> Hi!
>
> Commentaries like Rieger or MAK use the ThML/HTML escpae strings for umlauts
> etc.
> Although I use
> setEscapeStart("&");
> setEscapeEnd(";");
> addEscapeStringSubstitute("auml", "ä");
> addEscapeStringSubstitute("uuml", "ü");
> addEscapeStringSubstitute("ouml", "ö");
> neither the escape code nor the umlauts appear in the text. Does sombody know
> why this is happening? Maybe some other filter strips them out or does
> SWBasicFilter::ProcessText not work correctly?
Hi,
dunno if I'm completely right but I think the problem is the way
SWBasicFilter::substituteEscapeString works when escStringCaseSensitive
is set to false (which is the default).
In this case, the EscapeString is converted to uppercase before
being inserted into escSubMap, but substituteEscapeString doesn't
do this conversion when checking wether an EscapeString is in that
map or not.
Same thing for substituteTokens.
The attached patch is an attempt to fix this, so would you like to
try if the patch solves your problems?
-- Helmer
--Multipart_Thu__7_Mar_2002_09:11:08_+0100_08287448
Content-Type: application/octet-stream;
name="patch"
Content-Disposition: attachment;
filename="patch"
Content-Transfer-Encoding: base64
SW5kZXg6IHNyYy9tb2R1bGVzL2ZpbHRlcnMvc3diYXNpY2ZpbHRlci5jcHAKPT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpS
Q1MgZmlsZTogL3Vzci9sb2NhbC9jdnNyb290L3N3b3JkL3NyYy9tb2R1bGVzL2ZpbHRlcnMvc3di
YXNpY2ZpbHRlci5jcHAsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTYKZGlmZiAtdyAtdSAtcCAt
cjEuMTYgc3diYXNpY2ZpbHRlci5jcHA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