Solved

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

Posted on 2012-03-23
4
355 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

746 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

12 Experts available now in Live!

Get 1:1 Help Now