code: private String encodeString(String str) {
          m_buffer.setLength(0);
          char ch;
          int inx = 0;
          while (inx < str.length()) {
              ch = str.charAt(inx++);
              switch (ch) {
              case '"':  m_buffer.append("\\\""); break;
              case '\\': m_buffer.append("\\\\"); break;
              case '\b':  m_buffer.append("\\b"); break;
              case '\f':  m_buffer.append("\\f"); break;
              case '\n':  m_buffer.append("\\n"); break;
              case '\r':  m_buffer.append("\\r"); break;
              case '\t':  m_buffer.append("\\t"); break;
              default:
                  // All other chars are allowed as-is, despite JSON spec.
                  m_buffer.append(ch);
              }
          }
          return m_buffer.toString();
      }
docs: /// Private methods