diff --git a/include/ndn-cpp/name.hpp b/include/ndn-cpp/name.hpp
index 5ff50d9..5e92e77 100644
--- a/include/ndn-cpp/name.hpp
+++ b/include/ndn-cpp/name.hpp
@@ -148,18 +148,6 @@
     }
     
     /**
-     * Make a component value by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme.
-     * If the escaped string is "", "." or ".." then return a Blob with a null pointer, which means this component value was not changed, and
-     * the component should be skipped in a URI name.
-     * @param escapedString The escaped string.  It does not need to be null-terminated because we only scan to endOffset.
-     * @param beginOffset The offset in escapedString of the beginning of the portion to decode.
-     * @param endOffset The offset in escapedString of the end of the portion to decode.
-     * @return The component value. If the escapedString is not a valid escaped component, then the component value is a null pointer.
-     */
-    static Component 
-    fromEscapedString(const char *escapedString, size_t beginOffset, size_t endOffset);
-
-    /**
      * Create a component whose value is the network-ordered encoding of the number.
      * Note: if the number is zero, the result is empty.
      * @param number The number to be encoded.
@@ -446,6 +434,28 @@
   match(const Name& name) const;
   
   /**
+   * Make a Blob value by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme.
+   * If the escaped string is "", "." or ".." then return a Blob with a null pointer, which means this component value was not changed, and
+   * the component should be skipped in a URI name.
+   * @param escapedString The escaped string.  It does not need to be null-terminated because we only scan to endOffset.
+   * @param beginOffset The offset in escapedString of the beginning of the portion to decode.
+   * @param endOffset The offset in escapedString of the end of the portion to decode.
+   * @return The Blob value. If the escapedString is not a valid escaped component, then the Blob is a null pointer.
+   */
+  static Blob 
+  fromEscapedString(const char *escapedString, size_t beginOffset, size_t endOffset);
+
+  /**
+   * Make a Blob value by decoding the escapedString according to the NDN URI Scheme.
+   * If the escaped string is "", "." or ".." then return a Blob with a null pointer, which means this component value was not changed, and
+   * the component should be skipped in a URI name.
+   * @param escapedString The null-terminated escaped string.
+   * @return The Blob value. If the escapedString is not a valid escaped component, then the Blob is a null pointer.
+   */
+  static Blob 
+  fromEscapedString(const char *escapedString);
+
+  /**
    * Write the value to result, escaping characters according to the NDN URI Scheme.
    * This also adds "..." to a value with zero or more ".".
    * @param value the buffer with the value to escape
diff --git a/src/name.cpp b/src/name.cpp
index 22476af..d785fdd 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -7,6 +7,7 @@
 
 #include <stdexcept>
 #include <algorithm>
+#include <string.h>
 #include <ndn-cpp/name.hpp>
 #include "c/name.h"
 
@@ -125,26 +126,6 @@
 }
 
 Name::Component 
-Name::Component::fromEscapedString(const char *escapedString, size_t beginOffset, size_t endOffset)
-{
-  string trimmedString(escapedString + beginOffset, escapedString + endOffset);
-  trim(trimmedString);
-  string component = unescape(trimmedString);
-        
-  if (component.find_first_not_of(".") == string::npos) {
-    // Special case for component of only periods.  
-    if (component.size() <= 2)
-      // Zero, one or two periods is illegal.  Ignore this component.
-      return Component();
-    else
-      // Remove 3 periods.
-      return Component((const uint8_t *)&component[3], component.size() - 3); 
-  }
-  else
-    return Component((const uint8_t *)&component[0], component.size()); 
-}
-
-Name::Component 
 Name::Component::fromNumber(uint64_t number)
 {
   shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
@@ -241,7 +222,7 @@
     if (iComponentEnd == string::npos)
       iComponentEnd = uri.size();
     
-    Component component = Component::fromEscapedString(&uri[0], iComponentStart, iComponentEnd);
+    Component component(fromEscapedString(&uri[0], iComponentStart, iComponentEnd));
     // Ignore illegal components.  This also gets rid of a trailing '/'.
     if (component.getValue())
       components_.push_back(Component(component));
@@ -352,6 +333,32 @@
   return true;
 }
 
+Blob 
+Name::fromEscapedString(const char *escapedString, size_t beginOffset, size_t endOffset)
+{
+  string trimmedString(escapedString + beginOffset, escapedString + endOffset);
+  trim(trimmedString);
+  string value = unescape(trimmedString);
+        
+  if (value.find_first_not_of(".") == string::npos) {
+    // Special case for component of only periods.  
+    if (value.size() <= 2)
+      // Zero, one or two periods is illegal.  Ignore this component.
+      return Blob();
+    else
+      // Remove 3 periods.
+      return Blob((const uint8_t *)&value[3], value.size() - 3); 
+  }
+  else
+    return Blob((const uint8_t *)&value[0], value.size()); 
+}
+
+Blob 
+Name::fromEscapedString(const char *escapedString)
+{
+  return fromEscapedString(escapedString, 0, ::strlen(escapedString));
+}
+
 void 
 Name::toEscapedString(const vector<uint8_t>& value, ostringstream& result)
 {
