SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    1,967
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Replacing strange characters

    Wen I use copy and paste to add certain text to the database I get some strange characters like  and . Is there an easy way to get undo that?

    Thank you in advance

  2. #2
    SitePoint Enthusiast David.A's Avatar
    Join Date
    May 2010
    Location
    Milky Way Galaxy
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Those typically happen when you go from Word or some other RTF editor to something simple that only uses plain text. Things likes ` (Not actual character) should be ', so what you do is a find (`) and replace (') which will take care of everything like that. You may also need to do it for double quotes, and ellipses.

  3. #3
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    1,967
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that it comes from those word like programs and there lays my problem. I is for a site for someone else so It is very hard to control how they enter the text for their website. Is there not some kind of function that can replace those kind of characters?

  4. #4
    SitePoint Enthusiast David.A's Avatar
    Join Date
    May 2010
    Location
    Milky Way Galaxy
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could run a JS function searching for the special characters, you'll have to look up which ones are which. Or you could just tell the person that all text should be written in NotePad or WordPad.

  5. #5
    SitePoint Evangelist
    Join Date
    Mar 2007
    Posts
    584
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check cflib.org. Here's 1 function for removing special characters created by MS Word, etc.. They may have more.

    www.cflib.org/udf/demoronize

  6. #6
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    1,967
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi James that link is very helpful I should have a look over there more often. Thanks a lot.


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
  •