{convert2chars:text}

Description

Converts named HTML entities into the actual accented characters they stand for. For example the e-acute entity becomes an accented e, and the c-caron entity becomes an accented c (see the examples below for the literal entity syntax). Use it when content was stored or imported with accented letters written as HTML entities (for example from an RSS feed or a legacy import) and you want the real characters on output. The conversion uses a fixed lookup table covering Western European (Latin-1) accents plus Czech and Slovak carons and acutes. Entities that are not in that table are left untouched: numeric entities (the ampersand-hash-number form) are not converted, and named entities outside the set (such as the euro or copyright entity) pass through unchanged. The text is otherwise returned as-is.

Parameters

text required

The text to convert. Named HTML entities found in the lookup table (Latin-1 accents plus Czech and Slovak carons and acutes) become the matching accented characters; everything else is returned unchanged.

Examples

virtual{convert2chars:é}
Expected(e with acute accent - illustrative: an accented character cannot be stored as a test expected on this install)
Actualé
The named entity é becomes the character e with an acute accent.
test{ifeq:{convert2chars:é}:é:unchanged:converted}
Expectedconverted
Actualconverted
Proves a named entity in the table IS converted: the result no longer equals the literal é, so ifeq returns converted.
test{ifeq:{convert2chars:café}:café:unchanged:converted}
Expectedunchanged
Actualunchanged
Numeric entities like é are NOT in the table, so they are left unchanged and the result still equals the input.
virtual{convert2chars:Señor Muñoz}
Expected(Senor Munoz with tildes - illustrative: accented output is not storable as a test expected)
ActualSeñor Muñoz
Several entities at once: the Spanish n-with-tilde entities are decoded to real characters.
virtual{convert2chars:Příliš žluťoučký kůň}
Expected(the full Czech pangram with carons and the ring above u - illustrative: caron output is not storable as a test expected on this install)
ActualPříliš žluťoučký kůň
Czech and Slovak carons and acutes are in the table too. The engine output is correct; only storing it as a test expected is unsafe on this install.
test{seoname:{convert2chars:Žižkov údolí}}
Expectedzizkov-udoli
Actualzizkov-udoli
Real-world pattern: decode entities first, then slugify. Chaining with seoname produces a deterministic ASCII slug.