Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java JSP可以';不能显示俄语字符_Java_Html_Jsp_Encoding_Character Encoding - Fatal编程技术网

Java JSP可以';不能显示俄语字符

Java JSP可以';不能显示俄语字符,java,html,jsp,encoding,character-encoding,Java,Html,Jsp,Encoding,Character Encoding,我有一个JSP文件,其中包含带有俄语文本的段落。然而,无论我做什么,我都无法让浏览器显示这些文本——相反,我只能看到象形文字 相同的文本,但在没有任何标题或声明的简单HTML文件中可以正常工作: <html> <head></head> <body>some russian text</body> 'is displayed fine </html> “一些俄语文本”显示良好 但是,当我将该文件保存为JSP并尝

我有一个JSP文件,其中包含带有俄语文本的段落。然而,无论我做什么,我都无法让浏览器显示这些文本——相反,我只能看到象形文字

相同的文本,但在没有任何标题或声明的简单HTML文件中可以正常工作:

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

“一些俄语文本”显示良好
但是,当我将该文件保存为JSP并尝试在浏览器中查看时,文本就会被破坏

我试过了

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

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

我也试过了

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


但两者都不起作用。我的文件使用的是
UTF-8
编码。

jsp很可能没有使用
UTF-8
,请重试

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