Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display problem with Japanese characters

I am fetching a Japanese string from Oracle Database and displaying it on the browser. But the characters are shown on the browser like ???. Inserted the Japanese string into DB 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 logs ISO8859-1 when I printed System.getProperty("file.encoding").

select * from v$nls_parameters where parameter in ('NLS_CHARACTERSET') yields UTF8 in my DB.

Any pointers on how the Japanese characters could be displayed correctly ?

like image 938
bhavani Avatar asked Nov 27 '25 19:11

bhavani


2 Answers

you are try to change the ISO8859-1 into utf-8.

if above issue in struts use this code on your java.jsp page

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
like image 180
krishna ragav Avatar answered Nov 30 '25 09:11

krishna ragav


Try changing your browser locale. You can do it with Firefox.

like image 22
duffymo Avatar answered Nov 30 '25 08:11

duffymo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!