< Back

Document Subject: URL Special Characters
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#CharsInURL or http://A555F9/nn.nsf/ByAlias/CharsInURL

URL Special Characters, some characters need to be encoded.




In Lotus Notes R5 use @URLEncode("Domino""adam foster") to encode strings for URLs.

This is not a documented feature. The reason why is that if you try using "Domino" as the first parameter and try and encode strings that include "=" "!" "&" and probably a few others you get a strange result.

If you use "Internet" or "Platform" instead of "Domino" the strings encode ok.

This will encode names like  O'Callaghan and  Yl§nen  and  Tyrväinen.

Then use special field Query_String_Decoded to get the nicely decoded string.

 

 

For R4 applications, see below for code:

Certain characters are either determined to be unsafe or reserved, and thus may need to be encoded by escape sequences before a URL can be specified. These
escape sequences are of the format "%+ASCII-character-hexadecimal value".All unsafe characters should be encoded when constructing a URL, and these characters with their escape sequences are listed below:

SPACE %20
<   %3C
>   %3E
#   %23
%  %25
{   %7B
}   %7D
|    %7C
\    %5C
^   %5E
~   %7E
[    %5B
]    %5D
`    %60

Reserved characters are characters which have special meaning within specific schemes, and must be encoded when used in such schemes if they are to be used for a purpose other than that meaning. The escape sequences are listed below:

;       %3B
/       %2F
?      %3F
:      %3A

@    %40
=     %3D
&    %26

+     %2B

.      %2E

'       %27      useful for irish names   o'callaghan etc

I am always forgetting spaces in URLS here is a bit of code to neatly make sure spaces are replaced:

Dim s As New notessession
Dim db As notesdatabase
Set db = s.currentdatabase
Dim server As New notesname(db.server)

temp = "http://"; & server.common & "/" & db.Filepath & "/Display?openagent&name=Adam Foster likes kippers"
Msgbox temp


'Replace spaces with %20 in temp
While Instr(temp, " ")
temp = Left(temp, Instr(temp, " ")-1) & "%20" & Right(temp, Len(temp) - Instr(temp, " "))
Wend


Msgbox temp