|
I need to programatically replace " regular double quotes " with “ typographer's quotes ”
My initial thought is something like this:
<xsl:variable name="text"> <xsl:call-template name="replace-string"><!-- FYI: replace-string is a custom...
Started by joe on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
While there are issues....
The $1 is a back-reference to the first match.
Regex:replace($textVariable, '"([^"]*)"' , 'gi', '“$1”')
Havent " and replace that with your other typographical quotes.
Regular Expressions.
|
|
I have an application which uses a javascript based rules engine. I need a way to convert regular straight quotes into curl (or smart) quotes. It'd be easy to just do a string.replace for ["], only this will only insert one case of the curly quote.
The...
Started by BlueVoid on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Str = str.replace(/\b"/g, "”"); // Replace any quotes after a word // boundary with right curly quotes
(I've left the original.
, "”"); // Replace the rest with right curly quotes // or...
|
|
Hello all,
I have a text file (its comma delimited with some fields wrapped around in double quotes) when I parse through it using this:
if (($handle = fopen('C:\tester\fake.txt', "r")) !== FALSE) { while (($data = fgetcsv($handle, ",")) !== FALSE) { ...
Started by Abs on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
It does....
With fputcsv you can write a cvs-file.
Fgetcsv does remove the quotes.
The quotes are part of the CSV file format (quotes around fields that contains , or newlines), therefore fgetcvs will (and is expected to) remove them.
|
Ask your Facebook Friends
|
I have a file that contains "straight" (normal, ASCII) quotes, and I'm trying to convert them to real quotation mark glyphs (“curly” quotes, U+2018 to U+201D). Since the transformation from two different quote characters into a single one has been lossy...
Started by ShreevatsaR on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
(Just to make sure it hasn't made....
The program should ask you first for all the quotes that it can definitely assign to a function.
Closing quotes.
Opening quotes are always at the opening of a line or have a space in front of them.
|
|
As you know when Magic Quotes are ON, single quotes are escaped in values and also in keys. Most solutions to remove Magic Quotes at runtime only unescape values, not keys. I'm seeking a solution that will unescape keys and values...
I found out on PHP...
Started by AlexV on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
I think this is a little cleaner and avoids reference bugs:
function unMagicQuotify($ar) { $fixed = array(); foreach ($ar as $key=>$val) { if (is_array($val)) { $fixed[stripslashes... .
Array_walk_recursive($_POST, 'stripslashes');
Do the same for GET and COOKIE.
|
|
In JavaScript, it doesn't seem to matter whether you use single quotes or double quotes when writing strings. However, some programming languages treat them differently.
Is one more reliable than the other across multiple programming languages? Are there...
Started by Steve Harrison on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
In....
The meaning of quotes are very language dependant from the regular ' and " quotes.
Generally I use double quotes also in Javascript, because in the majority of the languages, but not in the other languages mentioned above.
|
|
I realized that I can have problems with single quotes in php arrays:
<?php $lang = array( 'tagline' => 'Let's start your project', "h1" => "About Me" ); ?>
So I changed it to double quotes:
<?php $lang = array( "tagline" => "Let's start...
Started by janoChen on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For me, that's using whichever quotes for the string that appear.
With single-quoted strings, you have simple-quotes to escape the double-quote special features.
Characters like \n , \t , ...
|
|
What is the difference between single quotes and double quotes in SQL?
Started by Vineet on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
You....
That's the primary use anyways.
Stick to using single quotes.
Double quotes generally aren't used in SQL, but that can vary from database to database.
Single quotes are used to indicate the beginning and end of a string in SQL.
|
|
I have the following function:
private static void prettyPrint(Document doc, File destFile) { TransformerFactory tfactory = TransformerFactory.newInstance(); Transformer serializer; try { if( !destFile.getParentFile().exists() ) { destFile.getParentFile...
Started by Benny on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Can you find out why the customer's XML parsing is broken double quotes by single quotes, although that would be a risky process as text nodes could also contain double quotes which you....
Should handle double quotes on input.
|
|
According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other?
Started by Readonly on
, 16 posts
by 16 people.
Answer Snippets (Read the full thread at stackoverflow):
I use double quotes in general, but not for any specific reason - Probably just out you are to want double quotes.
You might wish to encourage the use of the same type of quotes for strings that the other language I have seen.
|