Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your code change:</p> <pre><code>string localFile = @"C:\test\δοκιμαστικό αρχείο - Copy.txt"; String ftpname = "ftp://ftp.myhost.gr/public_html/test" + @"/" + Uri.EscapeUriString(Program.remoteFileName); FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpname); </code></pre> <p>To:</p> <pre><code>string remoteFileName = "δοκιμαστικό αρχείο - Copy.txt"; String ftpname = "ftp://ftp.myhost.gr/public_html/test" + @"/" + remoteFileName; var escapedUriString = Uri.EscapeUriString(Encoding.UTF8.GetString(Encoding.ASCII.GetBytes(ftpname))); var request = (FtpWebRequest)WebRequest.Create(escapedUriString); </code></pre> <p>This needs to be done because <a href="http://msdn.microsoft.com/en-us/library/system.uri.escapeuristring%28v=vs.110%29.aspx" rel="nofollow noreferrer">EscapeUriString</a>'s input parameter is escaped according to the RFC 2396 specification.</p> <p>The <a href="http://tools.ietf.org/html/rfc3986" rel="nofollow noreferrer">RFC 2396</a> standard states:</p> <blockquote> <p>When a new URI scheme defines a component that represents textual data consisting of characters from the Universal Character Set [UCS], the data should first be encoded as octets according to the UTF-8 character encoding [STD63]; then only those octets that do not correspond to characters in the unreserved set should be percent-encoded.</p> </blockquote> <p>Hence the code change shown above will force this string to be inputted in the UTF-8 format.</p> <p>With regards to:</p> <blockquote> <p>2) Why does a c# program depend on this setting? Is there a special methodology i should follow in order to avoid dependency from this setting?</p> </blockquote> <p>Uri.EscapeUriString needs input which follows the RFC 2396 specification, hence the need to pass it data in a format which it will understand.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload