Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts

    Exclamation My computer can't speak French. NOW SORTED.

    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.

    Frank

    This is the part of the javascript where it is entered. Just text.

    Code:
    // 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();
    Last edited by effpeetee; 12-11-2007 at 11:55 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    495
    Thanks
    0
    Thanked 82 Times in 80 Posts
    Use unicode "d\u00E9cembre"

  • #3
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by Fang View Post
    Use unicode "d\u00E9cembre"
    http://www.exitfegs.co.uk/

    Splendid! Have a butchers,

    Many thanks,

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,372
    Thanks
    32
    Thanked 286 Times in 280 Posts
    Quote Originally Posted by effpeetee View Post
    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.
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #5
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Quote Originally Posted by Arbitrator View Post
    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.
    I think that I understand Doctypes well enough, but the extra bit of <html xmins= etc, I really do not understand.

    What should I have put in the header? Or point me to a source of info.

    Regards

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,372
    Thanks
    32
    Thanked 286 Times in 280 Posts
    Quote Originally Posted by effpeetee View Post
    I think that I understand Doctypes well enough, but the extra bit of <html xmins= etc, I really do not understand.
    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.)

    Quote Originally Posted by effpeetee View Post
    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:

    Code:
    <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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #7
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Although characters inserted directly from Windows uses a subset of the ISO-8859-1 standard. For that reason, I always use ISO.

  • #8
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,372
    Thanks
    32
    Thanked 286 Times in 280 Posts
    Quote Originally Posted by CyanLight View Post
    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.

    Quote Originally Posted by CyanLight View Post
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #9
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    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.

  • #10
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,372
    Thanks
    32
    Thanked 286 Times in 280 Posts
    Quote Originally Posted by CyanLight View Post
    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).

    Quote Originally Posted by CyanLight View Post
    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.

    Quote Originally Posted by CyanLight View Post
    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
    1. http://en.wikipedia.org/wiki/Windows-1252
    2. http://www.babelstone.co.uk/Software/BabelMap.html

    Quote Originally Posted by CyanLight View Post
    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
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #11
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I'm not implying that W1252 is a subset of UTF-8, no.

    Quote Originally Posted by Wikipedia
    . . . 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.
    So MS Expression, Notepad++, Dreamweaver, Frontpage and good old Notepad don't count, then? =P

  • #12
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,372
    Thanks
    32
    Thanked 286 Times in 280 Posts
    Quote Originally Posted by CyanLight View Post
    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
    1. http://unicode.org/charts/ or http://unicode.org/charts/PDF/U0080.pdf

    Quote Originally Posted by CyanLight View Post
    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.

    Quote Originally Posted by CyanLight View Post
    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.

    Quote Originally Posted by CyanLight View Post
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #13
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Seriously... how the hell do you know so much?
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #14
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,372
    Thanks
    32
    Thanked 286 Times in 280 Posts
    Quote Originally Posted by ahallicks View Post
    Seriously... how the hell do you know so much?
    I wouldnít know where to start in answering that question. Letís just attribute it to magic.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #15
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    <!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
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •