SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Commas in different encodings

    I have this tag at the top of my page:
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    and my html documents are saved in utf-8 encoding.

    My question is: how do I get commas to work in the majority (if not all) encodings?

    Currently, I have found that the commas show up correctly in "Western European (Windows)" or "Western European (ISO)" but not in UTF-8.

    What to do?

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is your server sending your file as UTF-8 or in another character encoding via the HTTP headers it sends out with each request?

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have not uploaded any of my files yet. This is simply what I see happening on my own computer.

    Anyway, maybe I should upload them first and see if the commas work in different encoding when my files are online. Until then, perhaps it is not worthwhile to try to figure out what's wrong.

  4. #4
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you copy and paste text from a word document or something equivalent?

  5. #5
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    This is a comma "," it is number 44 in ASCII and is the same in UTF-8. The only reason why a comma would not be working is if the comma is not really a comma of position number 44.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  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)
    As logic_earth said, there should be no encoding issues with the comma, since it is encoded the same in all common Western encodings (ASCII, ISO 8859-x, Windows-125x, UTF-8, ...).

    If you're talking about apostrophes ('inverted commas'), then there might be an issue. But if you really save the files as UTF-8 and declare the encoding as UTF-8 everything should work.
    Birnam wood is come to Dunsinane

  7. #7
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have noticed that people who use Windows oriented editors quite often, and inadvertently save their work as windows-1252.

    Try re-opening the file in your editor, then, save-as (not save). Be very careful to specify utf-8, and not Unicode or Western European, etc..

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials


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
  •