PhpStorm 2023.2 Help

Code Inspection: Lossy encoding

Reports characters that cannot be displayed because of the current document encoding.

Examples:

  • If you type international characters in a document with the US-ASCII charset, some characters will be lost on save.

  • If you load a UTF-8-encoded file using the ISO-8859-1 one-byte charset, some characters will be displayed incorrectly.

You can fix this by changing the file encoding either by specifying the encoding directly in the file, for example, by editing encoding= attribute in the XML prolog of XML file, or by changing the corresponding options in Settings | Editor | File Encodings.

Suppress an inspection in the editor

  1. Place the caret at the highlighted line and press Alt+Enter or click the Intention action icon.

  2. Click the arrow next to the inspection you want to suppress and select the necessary suppress action.

Last modified: 24 August 2023