DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11132>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11132

Displays Trademark as "small box" in Excel (HSSF)





------- Additional Comments From [EMAIL PROTECTED]  2002-07-30 09:23 -------
I've done a nasty hack now for writing the trademark, but it works.

I use the following code:

response.setContentType("application/vnd.ms-excel");
response.addHeader("Content-Disposition", "filename=\"wank.xls\"");
DataOutput output = new DataOutputStream( response.getOutputStream() );
byte[] bytes = buffer.toByteArray();
response.setContentLength(bytes.length);

where the buffer is a ByteArrayOutputStream, and I write bytes[] out in a for-
loop. After looking, comparing and so on I found out that the tm is represented 
as the byte value -103.
Normally the Hex representation(as seen in ultraedit) of a trademark is a " 
followed by a !.
A tm written with hssf is represented by a tm and a ".".
Here's an example from ultraedit:

HSSF written:   ...99 00...

EXCEL normally: ...22 21...

what caused a great deal of confusion with me was the fact that the trademark 
is here written as hex 99(deci 153 which is the ascii value), and that 153 
doesn't occur in the outputstream. 

Maybe I'm stupid, but this is probably because I've forgotten all of my 
schooling through massive consumption of alcohol. I suppose it's because of 
binary conversion:

-103 = 01100111 (conversion)=> 10011000+1 = 10011001 = 153

But anyway, if I look at every single byte, and replace the value pattern 99 0 
by 22 21, the tm's in EXCEL are displayed allright. I suppose all ascii 
characters between 129 and 159 will have this problem.

If there are questions as to what the hell I'm talking about, please don't 
hesitate to ask here, I'll get an e-mail about it...

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to