Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,979
    Thanks
    120
    Thanked 76 Times in 76 Posts

    <jsp:include page="... UTF-8

    Code:
            <%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:
    Code:
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    on top of included page does not help. ?

  • #2
    Senior Coder ckeyrouz's Avatar
    Join Date
    Jun 2009
    Location
    Montreal, Canada
    Posts
    1,044
    Thanks
    5
    Thanked 179 Times in 179 Posts
    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.
    Software and cathedrals are much the same - first we build them, then we pray.

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,979
    Thanks
    120
    Thanked 76 Times in 76 Posts
    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:

    Code:
     <%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.
    Last edited by BubikolRamios; 11-16-2009 at 04:51 PM.

  • #4
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try adding the bold line to your code.

    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
    Last edited by sdhoigt; 01-04-2011 at 04:14 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •