SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Nov 2006
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dealing with accent marks

    I have not been updated on how to deal with accent marks... Most of the sites I work with are in french and I've been manually changing all the é to their anscii equivalent with the ampersign and number.. Do I really still have to change these manually or is there a magic phrase I can put into html so that I don't have to worry about the all the different accent characters?
    Last edited by prince_mallow; Jul 14, 2008 at 13:28. Reason: Forum parces Ampersigns
    Please...Never describe anything to me using foo and bar.

  2. #2
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Can you use find and replace? Dreamweaver is pretty good at this. It will do it site wide. Other applications can also do it.

  3. #3
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It all depends on which character encoding you use. UTF-8 or ISO 8859-1 should work well for French.

    As long as you use an encoding that allows a literal representation of those accented characters, there's no need whatsoever to replace them with entity references or numeric character references.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    While I wouldn't change content that was being sent to me, when I am building pages, even with UTF-8 in the document, in the meta tag and on the server, someone somewhere is going to have some goofy machine that ignores all that for some reason and gets ??? instead. So, at least for things like headers, menus, footers, if not the content, I still use the ascii (the hex actually).

    I also use them in place of the "character entities" since, when I started with my fake XHTML, I was taught that XML doesn't allow most of those, so &copy became & #169; and so-on.

    But that's me, it's a bit of extra work, and I likely wouldn't have to do it as even the WIndows users here have some charset that understands é as e with grave accent.

    Fortunately, as I understand it, UTF-8 is supposed to be the default for a UA if it doesn't know which charset a site is using?

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    In addition to what Tommy wrote, I personally prefer the named entity references, rather than the numbered ones
    That's fine, as long as you don't use XHTML and you're willing to take the (negligible) risk of problems in really old browsers.

    Quote Originally Posted by Stomme poes View Post
    Fortunately, as I understand it, UTF-8 is supposed to be the default for a UA if it doesn't know which charset a site is using?
    I think most browsers use Windows-1252 (or possibly ISO 8859-1) as the default encoding, since that's usually the encoding in point-and-click publishing tools used by non-savvy authors who don't set up their servers properly.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    In addition to what Tommy wrote, I personally prefer the named entity references, rather than the numbered ones, i.e. é rather than é and È rather than È (mainly because they're easier to remember).
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  8. #8
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    You can't count on the default, unfortunately. For some reason, my machine defaults to japanese, when encountering unescaped UTF-8 with the wrong content-header.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  9. #9
    SitePoint Addict
    Join Date
    Nov 2006
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow thanks for all the info... So I guess it's really split down the middle; I think I may try the UTF code for a while and see how that reacts on different systems..
    Please...Never describe anything to me using foo and bar.


Bookmarks

Posting Permissions

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