<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>cr/lf problem in calling a mail window</TITLE>

<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=289252915-11042002><FONT face=Arial color=#0000ff size=2>You're 
a genius !!!! really !!</FONT></SPAN></DIV>
<DIV><SPAN class=289252915-11042002><FONT face=Arial color=#0000ff size=2>It 
works exactly as I wanted it to .</FONT></SPAN></DIV>
<DIV><SPAN class=289252915-11042002><FONT face=Arial color=#0000ff size=2>I 
guessed it was a combination of a kind of escape sequence but didn't find out 
which one.</FONT></SPAN></DIV>
<DIV><SPAN class=289252915-11042002><FONT face=Arial color=#0000ff size=2>great 
thanks. :-))</FONT></SPAN></DIV><FONT face=Tahoma>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><BR><FONT size=2><SPAN 
class=289252915-11042002>&nbsp;</SPAN>-----Message 
d'origine-----<BR><B>De&nbsp;:</B> Peter Brunone 
[mailto:peter@brunone.com]<BR><B>Envoyé&nbsp;:</B> jeudi 11 avril 2002 
17:30<BR><B>À&nbsp;:</B> javascript@LaTech.edu<BR><B>Objet&nbsp;:</B> RE: 
[Javascript] cr/lf problem in calling a mail window<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2>Mathieu,</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=562481914-11042002>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
  color=#0000ff size=2>You are in effect&nbsp;sending this information through 
  the URL, so you need to encode it.&nbsp; Otherwise the slashes can be taken as 
  directory markings or escape characters... either way, you can't transfer a 
  crlf as such through the querystring.&nbsp; Some server-side engines have a 
  way around this; for example, ASP has a function called Server.URLEncode() 
  that can be used to encode all such troublesome 
characters.</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
  color=#0000ff size=2>The encoded value of cr/lf is %0A%0D; unfortunately, this 
  throws a javascript "unterminated string constant" error, which does not 
  happen with %20 (the encoded value for space).&nbsp; After some trial and 
  error, I found that you have to escape the *letter* in this encoded 
  value.&nbsp; Don't ask me why; perhaps someone with a better Jscript/C 
  background can say.</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
  color=#0000ff size=2>Anyway, the end result is that you should code like this 
  example, which works (watch for line wrapping):</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2>&lt;A 
  HREF="javascript:window.location.href='mailto:peter@brunone.com?Subject=My%20Mail&amp;Body=This%20is%20separated%0\A%0\Dfrom%20this';"&gt;Javascript 
  Mail&lt;/A&gt;</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=562481914-11042002>&nbsp;&nbsp;&nbsp; <FONT face=Arial 
  color=#0000ff size=2>Let me know how this works out for 
  you.</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2>Cheers,</FONT></SPAN></DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=562481914-11042002><FONT face=Arial color=#0000ff 
  size=2>Peter</FONT></SPAN></DIV>
  <BLOCKQUOTE dir=ltr 
  style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
    <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
    size=2>-----Original Message-----<BR><B>From:</B> 
    javascript-admin@LaTech.edu [mailto:javascript-admin@LaTech.edu]<B>On Behalf 
    Of </B>FERON Matthieu<BR><B>Sent:</B> Thursday, April 11, 2002 3:57 
    AM<BR><B>To:</B> Javascript (E-mail)<BR><B>Subject:</B> [Javascript] cr/lf 
    problem in calling a mail window<BR><BR></FONT></DIV>
    <P><FONT face=Arial size=2>Hello,</FONT> <BR><FONT face=Arial size=2>I use 
    this code to build a mail</FONT> <BR><FONT face=Arial size=2>&nbsp; 
    window.location = "<A 
    href="mailto:mymail@myserver.ext?Subject=Contribution">mailto:mymail@myserver.ext?Subject=Contribution</A> 
    HTM : &amp;Body=Titre:\nDescription:\nInsère ici un fichier zip contenant 
    les pages et images à relier\nDès que les pages seront intégrées dans le 
    site, tu recevras une confirmation par mail.";</FONT></P>
    <P><FONT face=Arial size=2>it works well and include my text in the right 
    place but the '\n' doesn't seem to work to include cr/lf.</FONT> <BR><FONT 
    face=Arial size=2>if anyone has an idea.</FONT> <BR><B><FONT 
    face="Comic Sans MS" size=2>Matthieu Féron</FONT></B> <BR><FONT 
    face="Comic Sans MS" size=1>mferon@adeuza.fr</FONT> <BR><FONT 
    face="Comic Sans MS" size=1><A target=_blank 
    href="http://ffwnet.phpnet.org">http://ffwnet.phpnet.org</A></FONT> 
  </P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>