Convert all types of smart quotes with PHP

You need something like this (assuming UTF-8 input, and ignoring CJK (Chinese, Japanese, Korean)): $chr_map = array( // Windows codepage 1252 “\xC2\x82” => “‘”, // U+0082⇒U+201A single low-9 quotation mark “\xC2\x84” => ‘”‘, // U+0084⇒U+201E double low-9 quotation mark “\xC2\x8B” => “‘”, // U+008B⇒U+2039 single left-pointing angle quotation mark “\xC2\x91” => “‘”, // U+0091⇒U+2018 left … Read more

How can I make Java print quotes, like “Hello”?

System.out.print(“\”Hello\””); The double quote character has to be escaped with a backslash in a Java string literal. Other characters that need special treatment include: Carriage return and newline: “\r” and “\n” Backslash: “\\” Single quote: “\'” Horizontal tab and form feed: “\t” and “\f” The complete list of Java string and character literal escapes may … Read more