From 75c74dd5951825b5e40e5bbe16ddd86f5e1c1108 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Thu, 21 Jun 2007 04:08:06 +0000 Subject: [PATCH] fix logging of chars < 32 git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@549356 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/solr/common/util/StrUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/solr/common/util/StrUtils.java b/src/java/org/apache/solr/common/util/StrUtils.java index 261973f59fc..9b876269b53 100644 --- a/src/java/org/apache/solr/common/util/StrUtils.java +++ b/src/java/org/apache/solr/common/util/StrUtils.java @@ -191,9 +191,8 @@ public class StrUtils { char ch = val.charAt(i); if (ch < 32) { dest.append('%'); - // Hmmm, if we used StringBuilder rather than Appendable, it - // could add an integer more efficiently. - dest.append(Integer.toString(ch)); + if (ch < 0x10) dest.append('0'); + dest.append(Integer.toHexString(ch)); } else { switch (ch) { case ' ': dest.append('+'); break;