Function overview
Prototype
RemoveSmartQuotes (
text )
Parameters
text
Description
Tags:
smart quote substitute apostrophe
FileMaker Pro has the option per file to use smart quotes which are represented as the curly quotation marks and curly apostrophes which is set via the File menu > File Options>Text tab. These smart quotes can cause problems when interfacing with external systems that don't support smart quotes.
This functions uses the new Char function in FileMaker Pro v10 to remove any single or double smart/curly quotes from the specified text and replace them with plain (straight) quotes and apostrophes. (You can make this function work with previous version of FileMaker by copy/pasting an example of each left/right single and double smart quote/apostrophe into the calculation in place of the Char function).
Examples
Sample input
“hello World”
Sample output
"hello World"
Function code
// SYNTAX: RemoveSmartQuotes (text)
// ORIGIN: http://www.databuzz.com.au
// NOTES: Removes Smart/Curly Quotes and Apostrophes from specified text into non smart/curly quotes and apostrophes. Requires FileMaker 10 or higher
// VERSION: 1.0v1
// © 2010 Andrew Duncan, Databuzz,Sydney, Australia
Substitute (
text ;
[ Char ( 8216 ) ; "'" ] ; // left smart quote
[ Char ( 8217 ) ; "'" ] ; // right smart quote
[ Char ( 8220) ; "\"" ] ; // left double smart quote
[ Char ( 8221) ; "\"" ] // right double smart quote
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/247
Prototype: RemoveSmartQuotes( text )
Function Author: Andrew Duncan (http://www.fmfunctions.com/mid/230)
Last updated: 09 February 2010
Version: 1
*/
// ===================================
// SYNTAX: RemoveSmartQuotes (text)__LITBR__ // ORIGIN: http://www.databuzz.com.au__LITBR__ // NOTES: Removes Smart/Curly Quotes and Apostrophes from specified text into non smart/curly quotes and apostrophes. Requires FileMaker 10 or higher__LITBR__ // VERSION: 1.0v1__LITBR__ // © 2010 Andrew Duncan, Databuzz,Sydney, Australia__LITBR____LITBR____LITBR__Substitute (__LITBR____LITBR__text ;__LITBR____LITBR__[ Char ( 8216 ) ; "'" ] ; // left smart quote__LITBR__[ Char ( 8217 ) ; "'" ] ; // right smart quote__LITBR____LITBR__[ Char ( 8220) ; "\"" ] ; // left double smart quote__LITBR__[ Char ( 8221) ; "\"" ] // right double smart quote__LITBR____LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/247__LITBR____LITBR__ Prototype: RemoveSmartQuotes( text )__LITBR__ Function Author: Andrew Duncan (http://www.fmfunctions.com/mid/230)__LITBR__ Last updated: 09 February 2010__LITBR__ Version: 1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.