EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Special Characters

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
Posted: 12/26/2010 02:59:45
by Jeff Newlin (Standard support level)
Joined: 12/26/2010
Posts: 19

I'm having an odd problem sending special characters within an XML string using the POST command of the component HTTPS client. A sample of this is :

FString := '<Name>Bill and Joe</Name>' ;
HTTPSClient.Post(SomeURLString, 'xml=' + FString) ;

This works just fine, but I'd like to be able to send the ampersand (&) character. To do this I change the above just slightly

FString := '<Name>Bill & Joe</Name>' ;
HTTPSClient.Post(SomeURLString, 'xml=' + FString) ;

This causes an error on my receiver's end. They want me to use escape sequences for this so I tried this :

FString := '<Name>Bill & Joe</Name>' ;
HTTPSClient.Post(SomeURLString, 'xml=' + FString) ;

But my receiver still has problems with the way it's coming over to them. There is also some difficulty finding out exactly what the string is that they are receiving so I'm asking if I should expect any sort of alteration of my string by the HTTPSClient because I'm using the special characters &

I thought I could monitor what was going out by checking the OnSendData event of the component. All I see is exactly what I am sending so it sure looks like everything is normal. Still I'm curious if there's any sort of change done somewhere in the POST command that might cause my message to change from what I think is going out.

Not sure if the problem is really with the HTTPSClient - I'm just trying to eliminate things.

Thanks for any info on this - I'm a bit stuck!

Posted: 12/26/2010 03:01:11
by Jeff Newlin (Standard support level)
Joined: 12/26/2010
Posts: 19

Sorry the escape sequences posted in the forum are being replaced (just like they should!) - so I'll put spaces in between them.

The sequence I am trying to use is & amp ;

Posted: 12/26/2010 05:26:40
by Eugene Mayevski (EldoS Corp.)

I got the idea. What they want you to do is to encode characters according to URI notation, and you are trying to use HTML encoding. You need to remember that HTTP and HTML are two different things.

Correct encoding is replacing each non-alphanumeric character in your URL with %xy, where xy is hexadecimal character code. For ampersand it's %26.

In SecureBlackbox 8.2 we will make HTTPSClient.URLEncode class method public. This method performs the above mentioned encoding.

Sincerely yours
Eugene Mayevski
Posted: 12/26/2010 13:32:20
by Jeff Newlin (Standard support level)
Joined: 12/26/2010
Posts: 19

Thank you very much Eugene. I'm a beginner in all of this for sure ! That's got me fixed!

Posted: 03/30/2015 02:57:06
by Walter Schrabmair (Priority Standard support level)
Joined: 05/03/2013
Posts: 149

Sorry, But I can not find teh URLEncode Methode in SecureBlackbox - version 12.0.255 - Released July 19, 2014.
In which unit is it public declared?
Posted: 03/30/2015 04:29:17
by Vsevolod Ievgiienko (EldoS Corp.)

In which unit is it public declared?


Its declared in SBEncoding unit.
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.



Topic viewed 1406 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!