PDA

View Full Version : Excel to webpage - Windows


BOAC
25th Nov 2009, 08:24
I'm trying to put a spreadsheet on a webpage. OpenOffice is vv ee rr yy slow to do this. I know MS has screwed up the WC3 side of the internet.

My page displays fine in IE. In Firefox it has the odd � dotted around in cells - something to do with cell format I think. Any ideas what this is and how I kill it?

bnt
25th Nov 2009, 10:36
Those � things look like symbols not being rendered correctly under the current codepage. Usually the headers on the web page say what encoding the characters in the page use, but this looks like a mismatch. My guess is that those are UTF-8 (Unicode) characters, but the page header doesn't say so. A page that renders UTF-8 should have the following at the top:
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

In Firefox, you can experiment with different codepages, under View / Character Encoding - you can test different options before modifying the page.

BOAC
25th Nov 2009, 11:11
Appreciate the fast response, bnt. The page is default saved in windows-1252. I have tried swapping the meta tag for yours and others in various codings and some give me little boxes instead of the diamonds after the text, others just don't display (and it looks GREAT in Chinese:))

However, in all the kerfuffle I have now replaced a 'space - ' with a ': space' in the text and for some reason known only to Mr G it now displays properly.

'Ours not to reason why....'?

bnt
25th Nov 2009, 17:39
I'm in front of a computer with Excel 2003, and having a look. First thing that stands out: you can choose which encoding to use for the page, as you save it, as follows:
- File / Save as Web page
- hit the Tools button (top right) and select "Web Options"
- on the "Encoding" tab, select another encoding. I recommend "Unicode (UTF-8)"

I just tried it with some weird characters - Greek, Russian, some weird maths symbols - all looked fine in Firefox and IE.
You can make this permanent if you change it under Tools / Options / General / Web Options.

It's going on the Web, after all i.e. ideally, nothing Windows-specific should be required, not even a character encoding. :8

BOAC
25th Nov 2009, 18:13
B****y brilliant! Thanks for that - I had not noticed the 'Tools' in the save page - doh! One more query, then, please - are you saying that utf-8 is ok for all systems/browsers?

bnt
25th Nov 2009, 19:21
I think it's safe to say that - it's mandated by the IETF in RFC 2277 - IETF Policy on Character Sets and Languages (http://tools.ietf.org/html/rfc2277) which says:

Protocols MUST be able to use the UTF-8 charset, which consists ofthe ISO 10646 coded character set combined with the UTF-8 character encoding scheme, as defined in [10646 (http://tools.ietf.org/html/rfc2277#ref-10646)] Annex R (published in Amendment 2), for all text.
RFCs don't use the word "MUST" unless they really mean it! :8

In case you're wondering: UTF-8 is the version of Unicode that uses standard ANSI 7-bit characters if it can, only going to Unicode for "foreign" characters. So, it's the best choice for documents that are mostly English characters, with only the occasional symbol or odd character, and files don't double in size if you use it. For other languages you'd use the relevant Unicode encoding.