1 Replies - 404 Views - Last Post: 06 December 2012 - 09:05 AM

#1 scottyadam  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 116
  • Joined: 03-December 07

Special Characters to Plain text in Javascript

Posted 06 December 2012 - 08:59 AM

I was going to make a function to do this but is there some function out there that will take all special characters out there (UTF 8) and just convert it over to plaintext? Essentially the plaintext would contain \n and \t still but the weird characters like this would be removed or converted to the equivalent plain text character.

Adam
Is This A Good Question/Topic? 0
  • +

Replies To: Special Characters to Plain text in Javascript

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,227
  • Joined: 08-June 10

Re: Special Characters to Plain text in Javascript

Posted 06 December 2012 - 09:05 AM

if "plain text" means ASCII, there is no way to convert non-ASCII UTF characters to ASCII (maybe except that you can convert a character to its numeric entity equivalent). though I wonder why that is needed as JS uses UTF-8 by default.

what do you consider a "weird character"?

This post has been edited by Dormilich: 06 December 2012 - 09:06 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1