I retrieve the Japanese row from the Oracle database and display it in the browser. But the characters are displayed in the browser as ???. Insert a Japanese row into the database using the unistr () function.
INSERT INTO MESSAGES (MESSAGE_ID,MESSAGE) VALUES (1,unistr('\0041\0063\0063\0065\0073\0073\0020\004d\0061\006e\0061\0067\0065\006d\0065\006e'));
I got this in my jvm magazines ISO8859-1when I printed System.getProperty("file.encoding").
ISO8859-1
System.getProperty("file.encoding")
select * from v$nls_parameters where parameter in ('NLS_CHARACTERSET')gives UTF8in my db.
select * from v$nls_parameters where parameter in ('NLS_CHARACTERSET')
UTF8
Any pointers to how Japanese characters can be displayed correctly?
Try changing your browser language. You can do this with Firefox.
, , Unicode. SO , Tomcat. , UTF-8, ISO-Latin-1/ISO-8859-1, Latin-1.
Unicode :
, Unicode ( ) , .
:
unistr ( '\ 0041\0063\0063\0065\0073\0073\0020\004D\0061\006e\0061\0067\0065\006D\0065\006e')
# 3 , .
??? -, / , , . , / Mojibake, . . , Firefox IE ???.
???
??? : HTTP, . - ?. - , . , ; DB , , .
?
, , Java -, , JSP/Servlet ( , , , ).
JSP, JSP, servletcontainer :
<%@ page pageEncoding="UTF-8" %>
, HTTP-- , :
response.setCharacterEncoding("UTF-8");
\0041\0063\0063\0065\0073\0073\0020\004d\0061\006e\0061\0067\0065\006d\0065\006e
"Access Managemen"
CHAR
unistr('\306b\307b\3093\3054')
"にほんご"
resultSet.getString(2);
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
ISO8859-1 UTF-8.
, java.jsp
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
Source: https://habr.com/ru/post/1755879/More articles:How can I detect WCF violations in my CI assembly - c #Я не понимаю пакет развертывания bulid в VS 2010 - visual-studioWhen deleting an entry indicated in another table, how do I know when to stop? - c #Unicode in Perl not working - perlOpenXml: copying OpenXmlElement between documents - mergeCRLF translation with Unicode in Perl - perlпостроить систему android на ubuntu 10.04 x86-64 ошибка внутреннего компилятора occrur - androidWhat is indexing in Core Data? - objective-cHow to match a spherical triangle to a flat triangle? - algorithmSimple algorithm for inverse matrix transformation - javaAll Articles