LoadRunner Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

web_convert_param at '@' symbol not properly converting

Highlighted
Valued Contributor

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)

1 REPLY
Valued Contributor

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