class TempletonUtils {

  public static String encodeArray(String[] plain) {
    if (plain == null)
      return null;

    String[] escaped = new String[plain.length];

    for (int i = 0; i < plain.length; ++i) {
      if (plain[i] == null) {
        plain[i] = "";
      }
      escaped[i] = StringUtils.escapeString(plain[i]);
    }

    return StringUtils.arrayToString(escaped);
  }

}