decode entities
This function decodes character entities entities (like € ac; €) into actual characters.
Note: Character entities specified as string constants inside single quotation marks (as softquoted strings) in the B4P code
will be converted automatically, quasi at compile time, and do not reuqire this function to be called.
Vectorization: This function supports vectorization in the 1st function parameter.
Instead of providing a single value, you can provide a set or even a nested set which contain multiple values.
The function will then process every value and its return value contains a corresponding set containing all results.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1
No. | Type | Description |
---|---|---|
1 input |
string set |
input string This string contains entity-encoded special characters. Vectorization can be used to provide multiple strings in a (nested) set. |
Type | Description |
---|---|
string set |
String with decoded characters Converted string with decoded characters. If vectorization is used, then a set containing multiple strings is returned. |
Invalid character code (outside 0 - 1114111 range)
echo( decode entities( "4.50 € / 4.50 € / 4.50 € / 4.50 €" ) );
echo( "4.50 €" ); // Quoted string are not decoded.
echo( '4.50 €' ); // Softquoted string is already decoded implicitly.
echo( '4.50 &eur' + 'o;' ); // This one is not because full entity is not in one softquoted string value
echo( decode entities({"4.50 €", "Café" }) ); // Vectorization example
4.50 € / 4.50 € / 4.50 € / 4.50 €
4.50 €
4.50 €
4.50 €
{'4.50 €','Café'}