SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Slovakia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question html/css web page - displaying "š" "č" characters

    Hey
    I'm having issues with displaying "š" and "č" characters in my html/css web page.
    there is no problem with "á" "í" or "é".
    I've tried many different windows pre-installed fonts, but they all display "s" instead of "š" and "c" instead of "č".
    I also thought that the problem might be my English DOCTYPE tag, but can't find any Slovak one.
    The page is supposed to be written in Slovak language, so i really need all these characters.

    Big Thanks! for any help guys.

  2. #2
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you specifying the UTF-8 character set?

    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" >

  3. #3
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,993
    Mentioned
    100 Post(s)
    Tagged
    0 Thread(s)
    Try switching to a UTF8 doctype
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  4. #4
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Slovakia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your advice, I've tried it but it didn't work.
    It actually displayed some weird question mark instead of "á" "í" and so.
    So I've checked some Slovak sites' <head>s to see how they do it,
    and it either utf-8 or windows-1250 in the most cases.
    Please if you have any thoughts what might be causing this problem,
    share them with me.
    Thanks!

  5. #5
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A link to your site would be a big help.

  6. #6
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Slovakia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok here is the link:
    riant.sk | web riesenia | dizajn | sadn Vm
    for example: 2nd menu item "web riesenia" is supposed to be "web riešenia"

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    If you don't want to leave this to chance, you can use character references instead. Just place &# before the number and ; after the number (with no gaps either side):

    For š use 154

    For č use 269

    For á use 224

    For í use 237

    For é use 233
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  8. #8
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Slovakia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just found out, that my notepad plus changes each š and č to s and c every time I restart it. I have English as default keyboard on my PC, so that's maybe making the mess.
    What do you think?

  9. #9
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Slovakia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i know about those references, but it slows my writing down too much.
    i can't imagine myself writing a number of pages like this.
    but thanks anyway

  10. #10
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by adam.snb View Post
    yeah i know about those references, but it slows my writing down too much.
    i can't imagine myself writing a number of pages like this.
    but thanks anyway
    You could always write the document as normal, with the accented characters, and then before you finally save it, just do a search-and-replace on each one with the relevant bit of code. Yes, it's still a bit of hassle, but at least it won't interrupt the flow of your writing.

  11. #11
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you Google for notepad++ utf-8, you'll find a lot of discussions about problems getting Notepad++ to deal with UTF-8 characters properly, along with a collection of suggested solutions. (I don't use Notepad++, so I can't really test any of it.)

    One proposed solution, that sounds promising:

    Blog Rat: How to make UTF-8 as default encoding in Notepad++ manually

  12. #12
    SitePoint Member
    Join Date
    Mar 2011
    Location
    Slovakia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, EarlyOut!
    The link you posted helped me to solve it in 2 minutes

    riant.sk | web rie?enia | dizajn | sadnú Vám

  13. #13
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good! I had a feeling that blogger was on the right track.

  14. #14
    SitePoint Addict
    Join Date
    Mar 2010
    Location
    UK
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never had any problems with getting NP++ to handle multi-byte characters, but I have always enforced the saving of documents as UTF-8.

    Regarding search and replace: run it on all files in a directory and you will find that it is very quick and convenient, without even needing to open any files. It even auto-saves all modified files for you.


Tags for this Thread

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
  •