Questions tagged [smart-quotes]

Smart quotes is a feature offered by some software (such as text editors), which automatically replaces vertical quotes and apostrophes with typographic quote characters (e.g. ‘ or ’, “ or ”) as user types.

Smart quotes is a feature offered by some software, such as text editors and word processors. It is about automatic replacement of vertical (neutral) quotes (") and apostrophes (') typed by user with typographic quote characters. Usually, software allows to enable or disable smart quotes.

Note that the term smart quotes refers to software feature, not to specific characters. There's no Unicode code point named "smart quote" or similarly.

Replacement characters differ depending on context: cursor at word beginning or end, current language, etc.

For example, replacement characters for vertical (double) quotes " are usually and in English, and in German, « and » in French or Russian.

See http://en.wikipedia.org/wiki/Quotation_mark

43 questions
48
votes
6 answers

HTML Best Practices: Should I use ’ or the special keyboard shortcut?

I know that ’ will produce an apostrophe in an HTML document. I also know that option shift right bracket on a Mac will simply produce a ’ character. Are there best practices for writing code, e.g., should I write The User’s…
user2238214
  • 505
  • 1
  • 4
  • 4
29
votes
12 answers

C# How to replace Microsoft's Smart Quotes with straight quotation marks?

My post below asked what the curly quotation marks were and why my app wouldn't work with them, my question now is how can I replace them when my program comes across them, how can I do this in C#? Are they special…
Jason P
25
votes
13 answers

How do I convert Word smart quotes and em dashes in a string?

I have a form with a textarea. Users enter a block of text which is stored in a database. Occasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: –, ’, “ ,†What function…
GloryFish
  • 12,027
  • 16
  • 50
  • 43
22
votes
7 answers

Converting ″Straight Quotes″ to “Curly Quotes”

I have an application which uses a Javascript-based rules engine. I need a way to convert regular straight quotes into curly (or smart) quotes. It’d be easy to just do a string.replace for ["], only this will only insert one case of the curly…
BlueVoid
  • 890
  • 1
  • 9
  • 24
11
votes
4 answers

how to get smart quotes on org-mode export?

How do I get Emacs org-mode to create proper typographic marks when I export to HTML, including converting straight quotes to smart quotes ("curly quotes") and converting hyphens --- to m-dashes —?
incandescentman
  • 5,479
  • 1
  • 37
  • 75
8
votes
2 answers

iOS 11 Safari HTML - Disable "Smart Punctuation"?

Is there a good way to disable the "Smart Punctuation" the iOS 11 Apple Keyboard generates - in Safari on an HTML login form - username field in particular? The problem is that we have users with apostrophes in their usernames. Typing their…
donatJ
  • 2,467
  • 2
  • 26
  • 38
8
votes
2 answers

MySQL choking on curly (smart) quotes

I'm inserting some data into a database from a form. I'm using addslashes to escape the text (have also tried mysql_real_escape_string with the same result). Regular quotes are escaped, but some other quotes are not. For example, the…
DisgruntledGoat
  • 62,693
  • 62
  • 192
  • 281
7
votes
3 answers

iconv gives "Illegal Character" with smart quotes -- how to get rid of them?

I have a MySQL table with 120,000 lines stored in UTF-8 format. There is one field, product name, that contains text with many accents. I need to fill a second field with this same name after converting it to a url-friendly form (ASCII). Since PHP…
Andrew Swift
  • 1,479
  • 2
  • 27
  • 46
6
votes
5 answers

SQL to replace smart quotes

Does anyone know a SQL command to replace MS Office smart quotes with their ASCII cousins? I'm using an oracle database and the fields are of type varchar2
GBa
  • 14,931
  • 15
  • 47
  • 67
6
votes
2 answers

"Smart Quotes" not displaying properly in email from phpmailer

I'm dealing with a LAMP web server. I have forms that users use to submit text that is stored in a text field in mysql. Often this text is copied and pasted from Microsoft Office products, so I'm getting a lot of smart quotes and emdashes. These…
ctb
  • 1,192
  • 1
  • 10
  • 23
5
votes
1 answer

Is there a category or name for characters like smart quotes and that dash that always breaks?

Many have probably experienced copying some text from Word into a website form or something, and all the quotes ('), double quotes ("), and dashes (-) get garbled. I believe the quotes are called "Smart Quotes" or "Typographer's Quotes", but I…
Mikey
  • 4,332
  • 9
  • 40
  • 70
4
votes
2 answers

C++ How to replace unusual quotes in code

sometimes when you copy code from a document it gets line numbers and strange quotes. I've written a script to remove those initial numbers but it is very hard to find a way to remove those strange quotes ‘’“” so I've included my full code. It reads…
Conor Ryan
  • 149
  • 1
  • 1
  • 12
2
votes
2 answers

Problem "smartening" and link-parsing the same text

I'm using jQuery, and a very simple script to replace quotes, apostrophes and double-dashes with their "smart" counterparts: function smarten(a) { a = a.replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018"); // opening singles a = a.replace(/'/g,…
Isaac Lubow
  • 3,498
  • 2
  • 33
  • 52
2
votes
4 answers

How could ASP server-side code corrupt a smart quote ’?

My company just converted many columns from varchar to nvarchar. Now it seems that when we render a smart quote (i.e. ALT+0146 ’) to the screen and then send it back to the SQL Server 2000 database for persistence, the smart quote gets corrupted to…
Jim G.
  • 14,056
  • 19
  • 94
  • 153
2
votes
2 answers

when copy/paste 'hello' from Word into textarea it becomes 018hello 019 after saving

I have in Word ‘hello’ and when I paste it I get 018hello 019 so the apostrophes turn into these strange characters. The type of web application should not matter as the behaviour is different depending on the workstation I use. I checked with…
mihai
1
2 3