function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JoyceJoyce 

WIL cannot handle special characters!

Salesforce Web Integration Links doesn't seem to handle special characters when any of the merge fields contain special characters.   This happens for Spanish tilde (~) and Portugues character (Ã!)   The special characters are converted to %C7 but in this conversion, it breaks the rest of the query string values.  I don't believe it is encoding the values correctly because the rest of the querystring following the conversion gets truncated.

These are the 2 examples

CATALUÃA  WIL becomes &cas15=TV+CATALU%D1A.  All values after tilde ~ are not recognize on page.

GRAÃ!A    Actual URL querystring comes out to &cas3=PAULA+GRA%C7A.  Any value after the special is will not be passed into the page. So, if the entire URL is this:

https://na1.salesforce.com/500/e?RecordType=0123000000000EF&cas3=PAULA+GRA%C7A&cas5=C3&cas6=PhoneCall

Only RecordType=0123000000000EF&cas3=PAULA+GRA (truncated after special character) is passed.  Anything else is ignored, which includes &cas5=C3&cas6=PhoneCall

Need fix for this as we have lots of special characters in our site

Thank you!

Joyce

JoyceJoyce

anyone have any info on this? 

Thank you!!

DevAngelDevAngel

Hi Joyce,

No info yet.  Will investigate.

DevAngelDevAngel

Hi Joyce,

Most development languages provide for URLEncoding and URLDecoding.  What is happening is that the special characters are being urlEncoded.  For the CATALUNA example the name is CATALU and then the urlencoded version the N with the tilde %D1 and then the last letter A.  To properly read this string you pass is through a utility that converts the escaped sequence %D1 back to the N. 

 

lee.boonstralee.boonstra
I have this issue aswell. But I know atleast a few solutions.

- before putting the mergefields in a get request let them show up  as a value in a (hidden) input text box. and by getting the elements by the id of this input text box, you can retrieve the value back again.

However this won't solve problems when ' or " or both are written in one of those mergefields.
I used this function to escape rare characters.

Code:
 RegExp.escape = function(text) {
   if (!arguments.callee.sRE) {
     var specials = [
     "'", '"', '/', '.', '*', '+', '—', '|',
       '(', ')', '[', ']', '{', '}', '\\'
     ];
     arguments.callee.sRE = new RegExp(
       '(\\' + specials.join('|\\') + ')', 'g'
     );
   }
   return text.replace(arguments.callee.sRE, '\\$1');
 }

 
Now I can let javascript escape the ' OR the "
But not both, since :
RegExp.escape("{!Opportunity.Description}");
is written with double quotes - so escapes the single quotes
and:
RegExp.escape('{!Opportunity.Description}');
is written with single quotes - so escapes only the double quotes.

Maybe someone else can help me further!?