You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2012/06/30 18:01:57 UTC

svn commit: r1355754 - /httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java

Author: olegk
Date: Sat Jun 30 16:01:56 2012
New Revision: 1355754

URL: http://svn.apache.org/viewvc?rev=1355754&view=rev
Log:
Escape non-ASCII chars using \uxxxx notation

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java?rev=1355754&r1=1355753&r2=1355754&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java Sat Jun 30 16:01:56 2012
@@ -169,7 +169,7 @@ public class TestURIBuilder {
         // Check that the URI generated by URI builder agrees with that generated by using URI directly
         final String scheme="https";
         final String host="localhost";
-        final String specials="/abcd!$&*()_-+.,=:;'~@[]?<>|#^%\"{}\\£`¬¦xyz"; // N.B. excludes space
+        final String specials="/abcd!$&*()_-+.,=:;'~@[]?<>|#^%\"{}\\\u00a3`\u00ac\u00a6xyz"; // N.B. excludes space
         URI uri = new URI(scheme, specials, host, 80, specials, specials, specials);
 
         URI bld = new URIBuilder()
@@ -198,7 +198,7 @@ public class TestURIBuilder {
         // Check that the encoded URI generated by URI builder agrees with that generated by using URI directly
         final String scheme="https";
         final String host="localhost";
-        final String specials="/ abcd!$&*()_-+.,=:;'~<>/@[]|#^%\"{}\\`xyz"; // N.B. excludes £¬¦
+        final String specials="/ abcd!$&*()_-+.,=:;'~<>/@[]|#^%\"{}\\`xyz"; // N.B. excludes \u00a3`\u00ac\u00a6
         final String formdatasafe = "abcd-_.*zyz";
         URI uri = new URI(scheme, specials, host, 80, specials,
                           formdatasafe, // TODO replace with specials when supported



Re: svn commit: r1355754 - /httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java

Posted by sebb <se...@gmail.com>.
On 30 June 2012 17:01,  <ol...@apache.org> wrote:
> Author: olegk
> Date: Sat Jun 30 16:01:56 2012
> New Revision: 1355754
>
> URL: http://svn.apache.org/viewvc?rev=1355754&view=rev
> Log:
> Escape non-ASCII chars using \uxxxx notation

That avoids the specific problem, but does not prevent a similar
occurrence at a later date, either in code or comments.

The fundamental problem is that fixcrlf relies on being able to
decode/re-encode its input.
Maybe there is a way to fix EOL using only byte scanning...

> Modified:
>     httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java
>
> Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java
> URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java?rev=1355754&r1=1355753&r2=1355754&view=diff
> ==============================================================================
> --- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java (original)
> +++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestURIBuilder.java Sat Jun 30 16:01:56 2012
> @@ -169,7 +169,7 @@ public class TestURIBuilder {
>          // Check that the URI generated by URI builder agrees with that generated by using URI directly
>          final String scheme="https";
>          final String host="localhost";
> -        final String specials="/abcd!$&*()_-+.,=:;'~@[]?<>|#^%\"{}\\£`¬¦xyz"; // N.B. excludes space
> +        final String specials="/abcd!$&*()_-+.,=:;'~@[]?<>|#^%\"{}\\\u00a3`\u00ac\u00a6xyz"; // N.B. excludes space
>          URI uri = new URI(scheme, specials, host, 80, specials, specials, specials);
>
>          URI bld = new URIBuilder()
> @@ -198,7 +198,7 @@ public class TestURIBuilder {
>          // Check that the encoded URI generated by URI builder agrees with that generated by using URI directly
>          final String scheme="https";
>          final String host="localhost";
> -        final String specials="/ abcd!$&*()_-+.,=:;'~<>/@[]|#^%\"{}\\`xyz"; // N.B. excludes £¬¦
> +        final String specials="/ abcd!$&*()_-+.,=:;'~<>/@[]|#^%\"{}\\`xyz"; // N.B. excludes \u00a3`\u00ac\u00a6
>          final String formdatasafe = "abcd-_.*zyz";
>          URI uri = new URI(scheme, specials, host, 80, specials,
>                            formdatasafe, // TODO replace with specials when supported
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org