SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2003
    Location
    scarborough
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quotes, apostrophes and special characters

    I am sick of wading through text documents which contain special characters which do not translate into html. Double quotes, apostrophes and certain other characters which look odd. How could I build a document which translates these into characters where there are no problems. The curly quotes and apostrophes do not translate properly. I would like to just create a text document which read correctly and eliminated these problem characters.

  2. #2
    SitePoint Addict Banana Man's Avatar
    Join Date
    Dec 2005
    Posts
    391
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What are you trying to do exactly? Are you talking about web pages when you say "text document"?

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2003
    Location
    scarborough
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am storing all articles for a website in text files. From there they are made into webpages according to my current template. Some of these contain strange characters which do not appear correctly when viewed. Double quotes (the curly ones) are shown as question marks. Pound signs (as in £ - I am from the UK) are shown oddly. Its a text encoding question. This is especially the case with people writing on apples as they seem to use a different sets of quotes (curly quotes not straight ones).

    What I want to do is to detect these rogue characters and then convert them to ones handled better.

  4. #4
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,807
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by hairybobby View Post
    I am storing all articles for a website in text files. From there they are made into webpages according to my current template. Some of these contain strange characters which do not appear correctly when viewed. Double quotes (the curly ones) are shown as question marks. Pound signs (as in £ - I am from the UK) are shown oddly. Its a text encoding question. This is especially the case with people writing on apples as they seem to use a different sets of quotes (curly quotes not straight ones).

    What I want to do is to detect these rogue characters and then convert them to ones handled better.
    There are numerous php functions that may satisfy your needs. Please supply a sample and your desired output.
    Last edited by John_Betong; Jun 6, 2013 at 16:11. Reason: spelling: not my fortay


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
  •