web_convert_param at '@' symbol not properly converting (216 Views)
Reply
Highlighted
Frequent Advisor
Posts: 58
Registered: ‎04-16-2013
Message 1 of 2 (216 Views)

web_convert_param at '@' symbol not properly converting

[ Edited ]
	lr_save_string("@", "atTestPLAIN");

	web_convert_param("atTestURL", "SourceString={atTestPLAIN}", "SourceEncoding=PLAIN", "TargetEncoding=URL", LAST );
	web_convert_param("atTestURL1", "SourceString=@", "SourceEncoding=PLAIN", "TargetEncoding=URL", LAST );

 

Protocol: web/http

Version: 11.52.4391.0

 

Using the code above, the @ symbol is not being converted to its percent encoded value (%40).  I received the following output when executing the code above.  

 

Starting action Action.
Action.c(4): Notify: Saving Parameter "atTestPLAIN = @".
Action.c(6): web_convert_param started [MsgId: MMSG-26355]
Action.c(6): Notify: Parameter Substitution: parameter "atTestPLAIN" = "@"
Action.c(6): Notify: Saving Parameter "atTestURL = @".
Action.c(6): web_convert_param was successful [MsgId: MMSG-26392]
Action.c(7): web_convert_param started [MsgId: MMSG-26355]
Action.c(7): Notify: Saving Parameter "atTestURL1 = @".
Action.c(7): web_convert_param was successful [MsgId: MMSG-26392]
Ending action Action.

 

According to RFC 3986 section 2.2 the @ symbol is reserved.  Section 2 of the RFC states ASCII hex values are the reference table for character replacements.  The ASCII table shows the @ symbol to have a hex value of 40.  

 

Therefore the @ symbol should be converted to a %40 in the web_convert_param function call when "SourceEncoding=PLAIN" and "TargetEncoding=URL".  

 

Is this a bug or am I missing something here?  

 

EDIT: I forgot to grammar ("it's" is not possessive)

Valued Contributor
Posts: 117
Registered: ‎04-30-2012
Message 2 of 2 (187 Views)

Re: web_convert_param at '@' symbol not properly converting

Even i faced this issue long time back.. i wrote a simple C code to do find and replace.

 

Ex: FindReplace("LR_Parameter","Find_String","Replace_String)

 

Thanks, Ajay

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.