473,698 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Not able to display the unicode characters using Sitemesh decorators

184 New Member
Hi,

Our application uses Spring MVC Framework and also it use sitemesh decorators to decorate the page.I have a problem in displaying the unicode characters in my application along with the decorator.

If i exclude the decorator, am able to display the unicode characters, but it should not be the solution. our application has to support the Japanese and chinese characters.


I have tried all the below items but no luck.

a) Included the page encoding and <meta> tag in both decorator and decoratee page
Expand|Select|Wrap|Line Numbers
  1. <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
  2. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
  3.  
b) In web.xml, i have included the below parameters for the character encoding filter
Expand|Select|Wrap|Line Numbers
  1. <filter>
  2.     <filter-name>encodingFilter</filter-name>
  3.     <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  4.     <init-param>
  5.         <param-name>encoding</param-name>
  6.         <param-value>UTF-8</param-value>
  7.     </init-param>
  8.     <init-param>
  9.         <param-name>forceEncoding</param-name>
  10.         <param-value>true</param-value>
  11.     </init-param>
  12.  </filter>
  13.  
  14.  
  15.  <filter-mapping>
  16.     <filter-name>encodingFilter</filter-name>
  17.     <url-pattern>/*</url-pattern>
  18.  </filter-mapping>
  19.  
c) In sitemesh.xml, i have the below entry
Expand|Select|Wrap|Line Numbers
  1. <sitemesh>
  2.     <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
  3.     <excludes file="${decorators-file}"/> 
  4.     <page-parsers>                
  5.         <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser"/>               
  6.     </page-parsers>
  7.  
  8.     <decorator-mappers>
  9.         <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
  10.             <param name="config" value="${decorators-file}"/> 
  11.         </mapper>
  12.     </decorator-mappers>
  13. </sitemesh>
  14.  
d) In controller, i have set the character encoding in both request and response.
Expand|Select|Wrap|Line Numbers
  1.     request.setCharacterEncoding("UTF-8");
  2.     response.setCharacterEncoding("UTF-8");
  3.     response.setContentType("text/html; charset=UTF-8");
  4.  
Thanks in Advance.
Sep 2 '11 #1
1 2560
drhowarddrfine
7,435 Recognized Expert Expert
This is a Java question, not HTML. However, if you can supply the generated markup or, preferably, a link, we might be able to help.
Sep 3 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7549
by: Daman | last post by:
Hi, I am currently facing difficulty displaying chinese, japanese, russian etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2 unicode database (UTF-8). The resultset that comes back contains garbage characters for Chinese, Russian etc languages. The english characters come back fine using ADO. It seems that DB2 assumes that my application is NOT Unicode compliant.
5
5129
by: Borko | last post by:
hi I am having problems getting unicode characters into VB. Using VB6 (sp3) and Access 2000 Characters are displayed correctly in Access, just when I use ADODB (2.7) to read them in VB i get ? character instead of unicode characters. I will display them in TreeView (capable of Unicode) Is there any patch, fix or something, I know this thing is going around
7
4302
by: c.verma | last post by:
I have a web application. There is a page which has a datagrid on it.The datagrid displays the data that comes from SAP. SAP sends the chinese characters to this grid. Before I display CHinese charactes, I have to use the following code to let it display on the web page: Public Function ToSCUnicode(ByVal str As String) As String Dim enc1252 As System.Text.Encoding = System.Text.Encoding.GetEncoding(1252) Dim arrByte_GBK As Byte() Dim...
3
2539
by: Christian Nunciato | last post by:
Hi all: I've read through the various related posts in this forum, but without any success as yet. I've got an ASP.NET application built in VS.NET 2003, and I'm trying to get the Armenian Unicode characters I type into the textboxes of my ASPX Web pages (via IE6) to post back to the server and get saved in my SQL database as Armenian Unicode characters. Not having much luck, though -- all I get back are question marks.
3
5432
by: Jennifer | last post by:
Hi, Is there anyone to have idea how to make the MFC CDialog box display Unicode (like Chinese characters) in .NET 2005? We have some dilog boxes created from CDialog class in VC++ 6.0 and try to integrate them into our new project developed in .NET 2005 to display Unicode. Any idea and hint will be greatly appreciated. Thank you in advance. Jennifer
6
5973
by: Bill Nguyen | last post by:
I'm getting data from a mySQL database (default char set = UTF-8). I need to display data in Unicode but got only mongolian characters like this: Phạm Thị Ngọc I changed the textbox font to Arial Unicode MS but still not working. Do I need conversion of data stored in mySQL database before displaying? Thanks Bill
1
9759
by: asiru | last post by:
My mission is to print Unicode characters using this program.I have been on this for several months. I follow the following procedure to enable unicode; 1.File > New> Project>win 32 console application> simple application. 2.File > New > c++ source file 3.Project > setting>(General tab)Not using mfc > (c/c++ tab)preprocessor > _UNICODE Precompiled header >Not using precompiled header #include<fstream.h> #include<stddef.h>...
6
14033
by: Shankar | last post by:
Hi, I am not able to print the Unicode character on the console. I tried with these API's 1) wprintf() displays ??????? 2) _cwprintf() displays
6
3917
by: geegeegeegee | last post by:
Hi All, I have come across a difficult problem to do with extracting UniCode characters from RTF strings. A detailed description of my problem is below, if anyone could help, it would be much appreciated. I've tried to make the problem as clear as possible, but if any clarification is needed please let me know. Task -Convert RTF2 formatted text containing foreign characters (UniCode) to PlainText. Background -We are using Stephan...
0
2646
by: Dilip | last post by:
I ran into a situation at work regarding unicode character encodings and .NET cultures that left me a tad bit confused. I was trying to instantiate a CultureInfo object from a locale identifying a south chinese destination called the Hmong. Its usually represented as hm-HMN. I peruse the NativeName property to extract the name of the culture and display it on my application. When I do: CultureInfo ci = new CultureInfo("hm-HMN");
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.