PDA

View Full Version : <jsp:include page="... UTF-8


BubikolRamios
11-16-2009, 12:19 PM
<%String tmpText = getdatafromdatabase();%>
// tmpText comes out here as 'čšž'
<jsp:include page="../WEB-INF/jspf/tooltip.jsp" flush="true" >
<jsp:param name="tooltip_text" value="<%=tmpText%>" />
</jsp:include>


in inluded page there are '?!..' instead of 'čšž'

even putting:

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

on top of included page does not help. ?

ckeyrouz
11-16-2009, 04:33 PM
Does the data coming from the data have the same encoding as the web page (ie: UTF-8)?

I mean your database and the tables work with utf-8 character set?

Please provide more details about your database.

BubikolRamios
11-16-2009, 04:44 PM
yes, database table column has charset utf-8 and colation utf8_slovenian_ci. Anyway:

correction: data are taken from database, but at the point when I need them they are in ArrayList, so:


<%String tmpText = getdatafromArrayList();%>
<%=tmpText%> <!--tmpText comes out here as 'čšž'-->
<jsp:include page="../WEB-INF/jspf/tooltip.jsp" flush="true" >
<jsp:param name="tooltip_text" value="<%=tmpText%>" />
</jsp:include>


and on included page comes out wrong.

sdhoigt
01-04-2011, 03:48 AM
Try adding the bold line to your code.


<% request.setCharacterEncoding("utf-8"); %>
<jsp:include page="../WEB-INF/jspf/tooltip.jsp" flush="true" >
<jsp:param name="tooltip_text" value="<%=tmpText%>" />
</jsp:include>


Reference.
http://d.hatena.ne.jp/ukonlly/20100522/1274503780