What potential encoding issues should be considered when working with multilingual sites in PHP?

When working with multilingual sites in PHP, potential encoding issues to consider include ensuring that the correct character encoding is used throughout the application, handling input/output in the appropriate encoding, and properly sanitizing and validating user input to prevent security vulnerabilities.

// Set the default character encoding to UTF-8
header('Content-Type: text/html; charset=utf-8');

// Convert input/output to UTF-8
$input = mb_convert_encoding($input, 'UTF-8', 'auto');

// Sanitize and validate user input
$clean_input = filter_var($input, FILTER_SANITIZE_STRING);