PHPStorm odd quotes

We sometimes have to copy content from files made in Microsoft Word or other bizarre text editors that save quotes as "smart" quotes or hyphens as other bizarre objects, but PHPStorm is not converting these even though file encoding is set to UTF-8, and it's causing some problems in different programs or the website.

How do we fix this? It's almost impossible to know when a lot of these weird characters will show up, and I just want keyboard characters in code.

5 comments
Comment actions Permalink

Is it possible that you share a file containing text to reproduce the issue so we can understand what you're talking about?

0
Comment actions Permalink

You've never run into word processors using non-standard quotes and hyphens? This is pretty typical from Word or other word processors. http://stackoverflow.com/questions/175785/how-do-i-convert-word-smart-quotes-and-em-dashes-in-a-string

Here's a picture example I made for you:


Notice how the first apostrophe looks different than the second; the first is the "smart" quote from Word, the second is me deleting that character and typing the single-quote key from my keyboard. The first quote shows as gobbledygook in other programs and can also in a browser.

I want PHPStorm to convert these non-keyboard characters to normal keyboard characters, preferably on paste.

0
Comment actions Permalink

In such cases we recommend to use a "Paste Simple" action (hotkey needs to be assigned in File | Settings | Keymap).

In some other cases (such as invisible null symbol at the end of a copied data) a detailed investigation is needed and it's better to submit such issues to our tracker (https://youtrack.jetbrains.com/)

0
Comment actions Permalink

Zero Width Characters Locator plugin can help with some of the invisible characters -- at least it will inform that there are some symbols in your file that can cause issues.

Some existing tickets:

0
Comment actions Permalink

Thanks Dmitry, Paste Simple works

0

Please sign in to leave a comment.