473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

wirting special characters out to excel in HTML

We have a web-based reporting application written in J2EE
that writes out to excel using response.setContentType
("application/vnd.ms-excel; ")….

The problem is that where we have any special characters
in our report result set E.g umlauts and accents ( ASCII
values 128 to 165 ) this data is corrupted, and does not
appear correctly.

The standard font family used throughout our Web Reports
is Arial,
I have seen this handled by using Verdana, however we are
reluctant to change the fonts in all our reports.

I believe this relates to Excel performing a unicode
translation, unfortunately we require Excel functionality
to enable users to perform operations on the finished
reports.

Is there a font family similar in appearance to Arial that
will handle the unicode character set?
Or is there a mechanism to tell Excel not to perform this
conversion?

thanks.

Jul 21 '05 #1
5 10417
Matthew Shaw <ma**********@hotmail.com> wrote:
We have a web-based reporting application written in J2EE
that writes out to excel using response.setContentType
("application/vnd.ms-excel; ")….

The problem is that where we have any special characters
in our report result set E.g umlauts and accents ( ASCII
values 128 to 165 ) this data is corrupted, and does not
appear correctly.
There *are* no ASCII values 128-165. ASCII is 7-bit.

Now, when you say the data is "corrupted", what exactly happens?
Perhaps it's writing it out in UTF-8 or something similar? How are you
writing out the data in the first place, exactly? (i.e what file
format, etc.)
The standard font family used throughout our Web Reports
is Arial,
I have seen this handled by using Verdana, however we are
reluctant to change the fonts in all our reports.

I believe this relates to Excel performing a unicode
translation, unfortunately we require Excel functionality
to enable users to perform operations on the finished
reports.

Is there a font family similar in appearance to Arial that
will handle the unicode character set?
I'd be very surprised if it were the font which was at fault here -
althoguh I could certainly be wrong.
Or is there a mechanism to tell Excel not to perform this
conversion?


How exactly are you exporting from Excel? Or are you only *importing*
into Excel? If you can specify somewhere which character encoding to
use, and make sure you use the same one everywhere, you should be okay.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2


We are only importing into Excel. You can explicitly provide a character
encoding...

E.G application/vnd.ms-excel;charset=ISO-8859-1

which I believe is default, others include charset=windows-1251.

They do appear to be producing slightly different results, however none
of the ones I have tried can handle umlauts...

thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
Matthew Shaw <ma**********@hotmail.com> wrote:
We are only importing into Excel. You can explicitly provide a character
encoding...

E.G application/vnd.ms-excel;charset=ISO-8859-1
Right - but if you explicitly provide the charset there, do you also
make sure your J2EE app is actually *using* that character set?
which I believe is default, others include charset=windows-1251.
Ah - if you're using 1251 that may well give different results to
ISO-8859-1. If you can get both sides to use UTF-8 I believe that's the
most likely to work for everything in a simple fashion.
They do appear to be producing slightly different results, however none
of the ones I have tried can handle umlauts...


Hmm... well, I hope the above is helpful...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4


I have tried the following
"application/vnd.ms-excel;charset=windows-1251",1250,1252

I believe the default is charset=ISO-8859-1

they do look as though they are altering the imported characters,
although they appear either as . , or ? , or just those wierd square
things that you get when you open a file using an editor that doesn't
support the file format.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5
Matthew Shaw <ma**********@hotmail.com> wrote:
I have tried the following
"application/vnd.ms-excel;charset=windows-1251",1250,1252

I believe the default is charset=ISO-8859-1

they do look as though they are altering the imported characters,
although they appear either as . , or ? , or just those wierd square
things that you get when you open a file using an editor that doesn't
support the file format.


Hmm. Thing is, if it's really writing an Excel spreadsheet then it's a
binary file to start with, which is part of what confuses me - unless
it's actually just writing CSV data and using the content-type to
direct it to Excel...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Barry Olly | last post by:
Hi, I'm working on a mini content management system and need help with dealing with special characters. The input are taken from html form which are then stored into a varchar column in...
1
by: quickcur | last post by:
I am rewrite some of my excel sheets to xml document. In my excel, there is a lot of special characters like "/", " " (space), "#", "+'. I am using a java program based on JDom to to create xml....
1
by: Tim | last post by:
I am exporting a dataset to Excel. I can successfully view the dataset in Excel however, there are special characters that are appearing in the form of Â, â€" and others. My code in C# starts...
5
by: Matthew Shaw | last post by:
We have a web-based reporting application written in J2EE that writes out to excel using response.setContentType ("application/vnd.ms-excel; ")…. The problem is that where we have any special...
3
by: orgelizer via AccessMonster.com | last post by:
I'm trying to enter some specific special characters (Ω, ±, ≥, ≤ for example) in Access. Knowing that ASCII should be ASCII, but with variations (the spice of life, right?), using the "Hold...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
2
by: umeshchitta | last post by:
Hi ALL, I written code to download data in Excel from webpage in PLSQL. i have used owa_util.mime_header to write data in excel.But if data cmng from db table is "32E104" then data in Excel...
2
by: matech | last post by:
I have a problem with uploading special characters from excel files to mysql 5. It doesn't matter if I use UTF-8 or iso-8859-1 when uploading the trademark ™ symbol. htmlspecialchars() or...
0
by: jpero09 | last post by:
Having some trouble writing out accented characters to an ms-excel type output from my asp.net page (c#). I've tried a few different charsets but every time the è on my page is getting rendered as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.