Display text from Bean in other language

N

nicky

Hello,

I have problem about bean which I call from jsp tag.
I meet it can't show result in format thai language
how I resolve this problem?

this is mybean............

public class String_bean{
private String message =
"สวัสดีค่ะ =
this is thai language";
public String getMessage(){
return(message);
}

public void setMessage(String message){
this.message = message;
}
}

my jsp tag..............

<html>
<body>
<%@page errorPage = "error.jsp" %>
<jsp:useBean id = "bean1" class ="mybean.String_bean" />
<jsp : getProperty name = "bean1" property = "message" / >
<br><br>
<%String bean = bean1.getMessage();%>
<%=new String(bean.getBytes("ISO8859_1"),"windows-874") %>
</body>
</html>

my result in browser..............

?????????



Please tell me,

Thank you.

Nicky
 
T

Thomas Fritsch

nicky said:
Hi Nicky,
may be the changes shown below will do it. But I was not able to test it
in my environment.
I have problem about bean which I call from jsp tag.
I meet it can't show result in format thai language
how I resolve this problem?

...

my jsp tag..............

<html>
<head>
<meta http-equiv="content-type"
content="text/html;charset=windows-874" />
<!-- Tells the browser that this HTML page is encoded in Thai -->
<body>
<%@page errorPage = "error.jsp" %>
<jsp:useBean id = "bean1" class ="mybean.String_bean" />
<jsp : getProperty name = "bean1" property = "message" / >
<br><br>
<%String bean = bean1.getMessage();%>
<%=new String(bean.getBytes("ISO8859_1"),"windows-874") %>
<!-- Change the line above to this: -->
<%=bean.getBytes("windows-874") %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top