5

I am developing an application with a Web interface, that is connecting up to an old Cobol mainframe, that uses CP437. We only have one system to communicate with, so if possible I would rather not do any charset conversions, and just use CP437 throughout.

I have changed the headers sent out with the HTML to show CP437 (in both the Apache header, and the meta tag):

Content-Type: text/html; charset=CP437
...
<meta http-equiv="Content-Type" content="text/html; charset=CP437">

It works well in internet explorer, with £ signs displaying correctly (pounds sterling, in case that symbol doesn't traslate!).

However, in Firefox, I just get the question marks in their place. In the Web Developer menu, the encoding shows as ISO-8859-1, so it looks like Firefox just doesn't recognise the character set.

Does anyone know how to get these working together? Is there anywhere a list of the character sets that Firefox knows about?

asc99c
  • 3,815
  • 3
  • 31
  • 54
  • 1
    The obvious answer: that's because Firefox doesn't support that ancient encoding (because there isn't a good reason why it should). ;) – Wladimir Palant Aug 22 '11 at 19:48

3 Answers3

2

http://mxr.mozilla.org/mozilla-central/source/intl/locale/src/charsetalias.properties is a close approximation of the charsets Gecko knows about. CP437 is not in fact one of them.

Boris Zbarsky
  • 34,758
  • 5
  • 52
  • 55
  • 1
    Thank you! Not the answer I was looking for :( but I think that is a pretty authoritative answer anyway! Will have to use iconv library and keep our internal database in unicode. – asc99c Aug 23 '11 at 10:33
2

One other thing that you could try is using CP850 which is pretty close to CP437. Some of the box characters differ but I don't think you're using them.

Chris Haas
  • 53,986
  • 12
  • 141
  • 274
  • 1
    +1 as it is a good idea for some uses. However, I think we may also need the currency symbols. I've not actually seen the Yen/Yuan symbol in the data set yet, but there are pounds and dollars, so we may well see it in future. – asc99c Aug 24 '11 at 13:33
0

It's a issue of the font the text is displayed with. Assuming windows as users OS you may set up your CSS to display all elements using the Terminal-font.

*{font-family:Terminal !important;}
Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • 2
    This doesn't appear to affect anything except the font that the text is displayed in. The 0x9c byte for the pound sign in CP437 is unassigned in ISO-8859-1, so I suspect even if a particular font specified a glyph to simulate another code page, Firefox might throw it out before trying to render that glyph. – asc99c Aug 22 '11 at 16:21
  • 1
    Not in Firefox, the encoding shows as Windows 1252 and I see the 'oe' ligature. In IE9, I see the pound sign, and the encoding shows as 'OEM United States'. I am assuming you're checking in Firefox also, which makes me suspect it is at least partially dependant on the underlying OS (if that is true, I'm not certain why it works in IE though...) – asc99c Aug 22 '11 at 17:21
  • Yes, for me it shows the pound in FF(6) and the detected cp is 1252(altough firebug shows cp437 in the content-type-header) – Dr.Molle Aug 22 '11 at 17:33