manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1441118 - /manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Encoder.java
Date Thu, 31 Jan 2013 18:52:30 GMT
Author: kwright
Date: Thu Jan 31 18:52:30 2013
New Revision: 1441118

URL: http://svn.apache.org/viewvc?rev=1441118&view=rev
Log:
Encode newlines and returns, to allow translations etc. to fit in quoted strings.  Part of
CONNECTORS-625.

Modified:
    manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Encoder.java

Modified: manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Encoder.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Encoder.java?rev=1441118&r1=1441117&r2=1441118&view=diff
==============================================================================
--- manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Encoder.java
(original)
+++ manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/util/Encoder.java
Thu Jan 31 18:52:30 2013
@@ -40,6 +40,18 @@ public class Encoder
       {
         rval.append("\\").append(x);
       }
+      else if (x == '\n')
+      {
+        rval.append("\\n");
+      }
+      else if (x == '\r')
+      {
+        rval.append("\\r");
+      }
+      else if (x == '\t')
+      {
+        rval.append("\\t");
+      }
       else
         rval.append(x);
     }
@@ -62,6 +74,18 @@ public class Encoder
       {
         rval.append("\\").append(x);
       }
+      else if (x == '\n')
+      {
+        rval.append("\\n");
+      }
+      else if (x == '\r')
+      {
+        rval.append("\\r");
+      }
+      else if (x == '\t')
+      {
+        rval.append("\\t");
+      }
       else
         rval.append(x);
     }



Mime
View raw message