> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating general functions

> Add the shared unescapeHTML function to your Pega library so HTML entity codes in FlexiCapture error messages display as readable Unicode characters.

To implement your scenarios, you will also need to create the following function:

## unescapeHTML

The *unescapeHTML* function converts HTML codes into Unicode characters. This function is needed for correctly displaying error messages.

**Input parameters**:

| **Name**   | **Java type** | **Description**      |
| ---------- | ------------- | -------------------- |
| htmlString | String        | String of HTML codes |

**Output parameter type**: *String* (string of Unicode characters).

The **Exceptions thrown** field should be left blank.

**Java source**:

```
//Unescapes a string containing entity escapes to a string containing the actual Unicode characters
//corresponding to the escapes. Supports HTML 4.0 entities. 
return StringEscapeUtils.unescapeHtml4(htmlString);
```
