How to Display UTF-8 Characters on a LiveCode Website

UTF-8 allows for the proper display of a number of special characters, and is also essential for multilingual characters.

We recommend using UTF-8 output for all of your websites, including LiveCode-powered websites.

Using LiveCode Server to Display UTF-8 Output

To display UTF-8 output using LiveCode Server, simply insert a put header line at the very top of your .lc file that appends the charset of UTF-8 to the Content-Type HTTP header.

Here’s an example of how this works:

<?lc put header "Content-Type: text/html; charset=UTF-8" ?>

<html> <body>

<?lc
put "<p>Hello!</p>"
put "<p>您好!</p>"
put "<p>வணக்கம்!</p>"
put "<p>こんにちは!</p>"
put "<p>Powered by LiveCode" && the version & "</p>"
?>

<p>Goodbye!</p>
<p>再见!</p>
<p>குட்பை!</p>
<p>さようなら!</p>

</body> </html>

This simple method allows you to include multilingual characters as-is in both the HTML and LiveCode-parsed portions of the file.

Remember to save your .lc file in UTF-8 format. Most modern text editors support this format, often by default.

Should you run into any issues or require further assistance, feel free to open a Client Care ticket via the Client Lounge, and we would be happy to assist.


Love our guides? HostM offers professional and helpful LiveCode Hosting services with unlimited features and renewal rates that actually match our advertised rates.