Solved

£ symbol it gets converted to £ when exported to MS Excel from JSP

Posted on 2012-03-23
4
358 Views
Last Modified: 2013-10-09
We use the displaytag tag library to export data from JSP to MS Excel. When we encounter the pound symbol in the data £, it gets converted to £. Thus an amount of £5.00 looks like £5.00.

I tried to extend the ExcelView class of the displaytag tag library and overrode protected String escapeToColumnValue(Object value) and remove the rogue character but it again comes back when the data is exported into excel.
0
Comment
Question by:ruchiabhi
4 Comments
 
LVL 5

Accepted Solution

by:
dcowley earned 500 total points
ID: 37763346
When I've seen problems like this historically it's been related to a mismatch in the character encoding of the source and destination, typically from a UTF-8 encoding to something else.

So in this case, you might want to try to convert the £ into a different encoding, perhaps ASCII encoding and see if that resolves the issue.

It would also depend I suppose on how you're currently encoding the symbol, whether it's a named entity, or if you're using a particular character code.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37765129
it's as dcowley explained: your jsp has to ensure that the data it reads from the backend is converted to a proper character set understood by the browser *and* that the web server anounces this character set properly (HTTP header *and* META tag in HTML)
then, if the browser sends back such data, you need to make the mapping reverse
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now