Skip to content

JSP can’t display Russian characters

I have a JSP file that contains paragraphs with Russian text. However, no matter what I do I can’t get a browser to display that text – instead all I get is hieroglyphs.

The same text but in a simple HTML file without any headers or declarations works fine:

  <body>some russian text</body> 'is displayed fine

But the moment I save that file as JSP and try to view it in a browser the text gets broken.

I tried

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Also I tried

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

But neither works. My file is in UTF-8 encoding.


jsp is most likely not using utf-8 ,try

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>