effpeetee 12-11-2007, 12:59 PM http://www.exitfegs.co.uk
If you look in at the index page on the site above. The time in French shows the second letter of the month oddly.
This is what it should be é but all it shows is a brown blob. Has anyone any ideas why? and what to do about it.:confused:
Frank
This is the part of the javascript where it is entered. Just text.
// begin clock script
var tday =new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
tday.push("Dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
var tmonth =new Array("January","February","March","April","May","June","July","August","September","October","Novem ber","December");
tmonth.push("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre"," novembre","décembre");
function GetClock(){
var d = new Date();
var nday = d.getDay();
var nmonth = d.getMonth();
Use unicode "d\u00E9cembre"
effpeetee 12-11-2007, 01:48 PM Use unicode "d\u00E9cembre"
http://www.exitfegs.co.uk/
Splendid! Have a butchers,
Many thanks,
Frank
Arbitrator 12-11-2007, 02:29 PM This is what it should be é but all it shows is a brown blob. Has anyone any ideas why? and what to do about it.:confused:I would hazard a guess that you don’t know what encoding you save your documents in and are blindly declaring UTF-8 as the character encoding (via a meta element). If so, then this is (was) probably an encoding issue.
By using Fang’s solution, you’ve stepped around the issue by converting the character into a multi‐character ASCII escape, which can be convenient, though isn’t very efficient.
effpeetee 12-11-2007, 02:41 PM I would hazard a guess that you don’t know what encoding you save your documents in and are blindly declaring UTF-8 as the character encoding (via a meta element). If so, then this is (was) probably an encoding issue.
By using Fang’s solution, you’ve stepped around the issue by converting the character into a multi‐character ASCII escape, which can be convenient, though isn’t very efficient.
Thanks Arbitrator,
Yes, my knowledge of this is very lacking. I usually pick the Doctype and its accompanying bits and pieces, from a list.:D
I think that I understand Doctypes well enough, but the extra bit of <html xmins= etc, I really do not understand.:confused:
What should I have put in the header? Or point me to a source of info.
Regards
Frank
Arbitrator 12-11-2007, 03:30 PM I think that I understand Doctypes well enough, but the extra bit of <html xmins= etc, I really do not understand.:confused:
The xmlns attribute has nothing to do with the issue. I will tell you that the attribute name is an abbreviation that stands for “XML namespace” and that it’s there to allow you to mix XML languages (such as XHTML itself) with other XML languages into a single document.
However, namespaces are rendered useless when you serve XHTML as HTML instead of XML. IMO, it’s just another reason not to use XHTML when HTML does the job just fine (until WIE supports XHTML as XML anyway). (My argument is that, basically, you have to insert stuff like this that’s useless to you to comply with XML rules when you don’t intend to actually serve the document as XML.)
What should I have put in the header? Or point me to a source of info.You need to figure out which encoding is being used by your HTML editor to save documents with. You might find this information in the save dialogue window (e.g., Microsoft Notepad), in the status bar (e.g., Notepad++ and jEdit), or elsewhere. Preferably, you should also figure out how to set the encoding used to save your documents too.
After you do that, change the utf-8 part of the following meta element (or insert one into the head element of the document if there is no pre‐existing element) to match the actual encoding:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Alternatively, you can set the Content-Type HTTP header if you know how to do that or, better yet, set both the HTTP header and add/change the meta element.
The recommended encoding is UTF-8.
Apostropartheid 12-11-2007, 04:22 PM Although characters inserted directly from Windows uses a subset of the ISO-8859-1 standard. For that reason, I always use ISO.
Arbitrator 12-11-2007, 05:12 PM Although characters inserted directly from Windows uses a subset of the ISO-8859-1 standard. For that reason, I always use ISO.ISO-8859-1 is a subset of UTF-8. Windows-1252 is not, however; it has unofficial (e.g., not Unicode‐defined) mappings to the private use code points. You’ll often find that ISO-8859-1 works flawlessly for Windows-1252 documents using the characters with the proprietary mappings too though since modern, major browsers are designed to (incorrectly) pretend that ISO-8859-1 is actually Windows-1252.
Admittedly though, the U+00E9 LATIN SMALL LETTER E WITH ACUTE (é) character is not actually one of the conflicting characters between UTF-8 and Windows-1252 (according to Wikipedia, at least), but there could be some issue that I don’t know about, their article could be wrong, or effpeetee’s documents could be using a different encoding.
For that reason, I always use ISO.I don’t really understand the line of reasoning. Why would you choose a more restrictive character set? The only reason that I can think of is that your preferred HTML editor doesn’t support UTF-8 without a BOM and you use PHP.
Apostropartheid 12-11-2007, 05:25 PM Windows 1252 is a superset of ISO-8859-1, which, according to you, is a subset of UTF-8. Fair enough.
Apparently most of the invalid character mappings are a range of control characters that are illegal in web documents in any case. I generally don't use escaped characters, preferring to use characters from WinXP char. map, which, when pasted, is in Windows 1252. So, to display properly, I use ISO-8859-1.
I have no preferred HTML editor. I switch depending on what takes my fancy.
Arbitrator 12-11-2007, 05:57 PM Windows 1252 is a superset of ISO-8859-1, which, according to you, is a subset of UTF-8.The first part of your statement is correct, but if you’re implying that Windows-1252 is a subset of UTF-8, that would be incorrect (as far as glyph associations go anyway).
Apparently most of the invalid character mappings are a range of control characters that are illegal in web documents in any case.Perhaps I should have linked to the Wikipedia article [1] that I previously mentioned. Take a look at the table in the article and note the yellow cells; those are not control characters.
I generally don't use escaped characters, preferring to use characters from WinXP char. map, which, when pasted, is in Windows 1252. So, to display properly, I use ISO-8859-1.Shouldn’t you be using Windows-1252 instead of ISO-8859-1 then? I would expect your editor to convert the characters to the native encoding though, so I still don’t really see why you wouldn’t be using UTF-8. (At least, when I copy one of the Windows-1252 problem characters from Character Map into a Notepad++ document encoded as UTF-8, I don’t experience any issues.)
Personally, I either type the characters directly via remembered decimal or hexadecimal codes (you may need to alter a registry entry to type via hexadecimal in Windows XP) or copy and paste from BabelMap [2], which is far superior compared to Microsoft’s Character Map program.
References
http://en.wikipedia.org/wiki/Windows-1252
http://www.babelstone.co.uk/Software/BabelMap.html
I have no preferred HTML editor. I switch depending on what takes my fancy.Maybe you haven’t found a good one yet then. :p
Apostropartheid 12-11-2007, 10:34 PM I'm not implying that W1252 is a subset of UTF-8, no.
. . . but differs from the IANA's ISO-8859-1 by using displayable characters rather than control characters in the 0x80 to 0x9F range. So the differences are control characters.
I do generally use named characters for the ones excluded in the ISO standard but included in Windows, e.g. the em dash and curved quotes. I'm useless at remembering numbers, so refuse the (hexa)decimal method. I can remember the alt code for the small letter eth, because it's in my sweetheart's name, but that's it.
Btw, isn't the native encoding Windows 1252? Seeing as that's what the OS is actually running under...meh, gets a bit complex, really.
Maybe you haven’t found a good one yet then. :p
So MS Expression, Notepad++, Dreamweaver, Frontpage and good old Notepad don't count, then? =P
Arbitrator 12-12-2007, 06:40 AM So the differences are control characters.My mistake. I just looked up the relevant code chart [1] and found that they are indeed control characters rather than private use areas (and BabelMap agrees).
References
http://unicode.org/charts/ or http://unicode.org/charts/PDF/U0080.pdf
I do generally use named characters for the ones excluded in the ISO standard but included in Windows, e.g. the em dash and curved quotes. I'm useless at remembering numbers, so refuse the (hexa)decimal method. I can remember the alt code for the small letter eth, because it's in my sweetheart's name, but that's it.I typically enter special characters via the Alt key plus keypad method. I just realized that the non‐hexadecimal numbers that I’ve been entering are the Windows-1252 codes (e.g., Alt+0151 for the em dash (—)) rather than decimal… Still, the characters get output at their Unicode code points instead of their Windows-1252 code points (at least in BabelMap), so I guess it doesn’t matter much unless I’m creating a document that isn’t UTF-8–encoded. I’ll working on transitioning myself to the hexadecimal codes anyway.
Btw, isn't the native encoding Windows 1252? Seeing as that's what the OS is actually running under...meh, gets a bit complex, really. Presumably, assuming that you live in certain Western nations. That doesn’t mean that you need to write documents in it. Personally, I’m trying to get away from proprietary Microsoft creations and Windows-1252 is one of them.
So MS Expression, Notepad++, Dreamweaver, Frontpage and good old Notepad don't count, then? =P
Notepad++ is good, aside from being platform‐dependent and not being able to save UTF‐8 without a BOM properly.
Microsoft Notepad sucks functionality‐wise after you’ve used a more advanced editor; it suffers from both of the mentioned issues and more (most noticeably, it can’t do multi‐line tabbing or handle multiple documents via tabs).
I haven’t used Frontpage since Frontpage Express 98 on my first computer (a Windows 98 SE machine) and wouldn’t anyway since I believe it’s designed around the quirks of Internet Explorer (or was then) and, of course, is another Microsoft product.
I haven’t used Dreamweaver and I don’t think I will at $399 USD for the CS3 version unless someone gives it to me for free. If Adobe’s other Web development product, GoLive (CS2), is any indication though, it’s mostly unnecessary bloat‐ware.
I’ve heard good things about Microsoft Expression Web (considering that it comes from Microsoft, that is) like how it’s more standards‐compliant than their actual browser, but it’s still a Microsoft product, so I have to write it off.
ahallicks 12-12-2007, 09:29 AM Seriously... how the hell do you know so much? :p
Arbitrator 12-12-2007, 09:51 AM Seriously... how the hell do you know so much? :pI wouldn’t know where to start in answering that question. Let’s just attribute it to magic.
effpeetee 12-12-2007, 10:35 AM <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Is this what I need to use.
(Going back to my original enquiry)
Frank
Apostropartheid 12-12-2007, 04:14 PM Yep, although a lang="fr" attribute would be nice :D
@ Arbitrator: You can't write off MS Expression Web because it's a Microsoft product. It does fairly well, is standards compliant and, in general, feels good to use. I hate Macs, especially their price vs hardware, but that doesn't stop me from getting iPod Touch for xmas =D. The only thing I don't like about it is its use of JS for rollovers.
|
|