java


Print HTML entities from CSV file


Using JSP on a Tomcat I need to load a CSV file and then create an XML output for it to show be shown in the screen.
My problem is that sometime this CSV file has special characters like ç, á, é, ó, etc.
And in the Web Output (screen) I need to print the ISO-8859-1 entities equivalency, say, instead of ç I need to show ç
So word açucar needs to be shown as: açucar
I can read the CSV file but can't figure out how to tell JSP to print those html entities as I need to.
So if CSV file is:
product;quantity;value
açucar;5723;7.00;
I need to print in my screen something like:
<item>
<product>a&#xe7;ucar</product>
<quantity>5723</quantity>
<value>7.00</value>
</item>
Any idea how to do this?
Why can't you just use UTF-8 or something like that? Surely any web browser should accept it.
Otherwise, you might want to have a look at this:
Recommended method for escaping HTML in Java

Related Links

MouseDragged event is too slow
BufferedWriter line separator becomes double line separator
Errror with method postFlush in Hibernate Interceptors
Arabic encoding error when using requests restful client
String to enum using valueOf crashes with java.lang.IllegalArgumentException [duplicate]
How can I include(load) more than one jsp files in spring mvc controller class?
Java TCP IP server client readline for TOF simulator
Server echoing back using Datagram Sockets in java
Why toString method won't get the selected item in JComboBox?
Apache Commons hashCode builder inconsistent hashes
Compare two Strings to be equal
How to split the text using selenium webdriver? [closed]
How do I get my server to print the input from my client class?
Android Paginated Map Bad Performance
Saving a dinamic SQL query to CSV?
Exception from GenericFilterBean are not catched with global exception handler #ControllerAdvice

Categories

HOME
compiler-construction
sendgrid
arduino-uno
winforms
openlayers
hive
urbancode
google-play
smarty
tesseract
at-command
electronics
echarts
add
user-input
etl
resize
serverless-framework
foselasticabundle
django-admin
propel
solaris-10
database-replication
evopdf
text-rendering
nodatime
grails3
swiftlint
java-3d
riot.js
opencover
semantic-analysis
fgetcsv
maquette
elasticsearch-ruby
log4js-node
compatibility
c++-amp
google-cloud-nl
lightswitch-2013
ecto
azure-sql-database
automake
unobtrusive-validation
android-fingerprint-api
leading-zero
cookiecutter-django
hp-ux
grid.mvc
texmaker
isbn
gpx
alphabet
togetherjs
nsarray
boost-preprocessor
zendesk-app
sonarlint-vs
crosswalk-runtime
smart-table
pycaffe
wdf
libpng
file-writing
fputcsv
superstack
testng-dataprovider
pagerank
itextpdf
two-factor-authentication
pyke
kendonumerictextbox
rtbkit
vhd
google-places
muse
oberon
web-controls
graph-api-explorer
pretty-print
facebook-graph-api-v2.4
rake-task
tween
angularjs-ng-click
xcode-6.2
html-helper
xojo
sgen
funcunit
yorick
expected-exception
hippomocks
uv-mapping
ms-project-server-2010
back-stack
ember-app-kit
factory-method
funscript
runas
ticoredatasync
jquery-ui-layout
spring-portlet-mvc
custom-backend
transactionscope
locate
lpeg
yslow
digest-authentication
dbal
data-driven
zend-decorators
geneva-server
signal-handling

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile