Passing string with slash character to function truncated

The only way I could find to get around this was to replace all ‘/’ with ‘<encoded_slash>’ in the javascript and switch it back in the HEScript. I suspect I’ll find some other characters with a similar problem so I’d love to know the right way to get around this “bug”.

09 is displayed in the message box as well as what is pasted from the clipboard. I’ve tried surrounding it with quotes and double quotes as well as URI encoding it but haven’t had any luck.

This seems like it should be really basic so I have to be doing something wrong. I’m calling a HEScript procedure from javascript passing it a string. The string happens to have a slash character in it and the I use the string passes it is being truncated before the slash character.

Javascript:

exeoutput.RunHEScriptCom("scripts.CopyToClipboard|09/12/2013");  

The HeScript procedure:

procedure CopyToClipboard(s: String);          
begin                                                                      
    MessageDlg(s, "The text", mtInformation, [mbOK]); // test message so i can see what is getting into the procedure  
    SetClipboardText(s);                                                   
end;

Looks like an encoding problem.
When you run the code, what is displayed in the message box by MessageDlg?