How-to articles, tricks, and solutions about ENCODING

How can I write a file in UTF-8 format?

To write a file in UTF-8 encoding with PHP, you can use the fopen, fwrite, and fclose functions.

How to convert Strings to and from UTF8 byte arrays in Java

To convert a String to a UTF-8 encoded byte array in Java, you can use the getBytes method of the String class and specify the character encoding as "UTF-8".

How to Encode JavaScript Object to Query-String

Read this JavaScript tutorial and learn useful information about the two widely used methods that are used for encoding objects to query strings easily.

How to Encode JavaScript URL

In the tutorial, you can read and learn useful information about the two JavaScript functions that are used for encoding URL and their use cases in detail.

How to HTML-encode a String

Read this JavaScript tutorial and learn about some useful and fast methods that help you to HTML-encode the string without causing the XSS vulnerability.

Java URL encoding of query string parameters

To URL encode the query string parameters of a URL in Java, you can use the URLEncoder class from the java.net package.

utf-8 special characters not displaying

This issue is likely caused by a mismatch between the character encoding used by the source of the text (e.g.

Working with UTF-8 encoding in Python source

Here is a code snippet that demonstrates how to work with UTF-8 encoding in a Python source file: