Unescapes a Soy string, according to JavaScript rules.
508345
@SuppressWarnings("unused") // called in SoyFileParser.jj
  public static String unescapeString(String s, ErrorReporter errorReporter, SourceLocation loc) {
    StringBuilder sb = new StringBuilder(s.length());
    for (int i = 0; i < s.length(); ) {
      char c = s.charAt(i);
      if (c == '\\') {
        i = doUnescape(s, i + 1, sb, errorReporter, loc);
      } else {
        sb.append(c);
        i++;
      }
    }
    return sb.toString();
  }
571882
@NotNull
    public static String unescapeChar(@NotNull final String string, final char toUnescape) {
        final String toUnescapeStr = String.valueOf(toUnescape);
        return string.replaceAll("\\\\" + toUnescapeStr, toUnescapeStr);
    }
1336307
def clean_string(text):
    
    if isinstance(text, six.string_types):
        return text.translate(UNI_SPECIAL_CHARS).strip()
    return text.translate(None, STR_SPECIAL_CHARS).strip()
1252974
public static String unescape(String input, char echar, char[] allowEscaped) {
        return unescape(input, echar, allowEscaped, new char[0]).unescaped;
    }
88830
public static String unescape(String in) {
        StringBuilder out = StringUtil.borrowBuilder();
        char last = 0;
        for (char c : in.toCharArray()) {
            if (c == ESC) {
                if (last != 0 && last == ESC)
                    out.append(c);
            }
            else 
                out.append(c);
            last = c;
        }
        return StringUtil.releaseBuilder(out);
    }
206512
function unpad(str) {
  const lines = str.split("\n");
  const m = lines[1] && lines[1].match(/^\s+/);
  if (!m) {
    return str;
  }
  const spaces = m[0].length;
  return lines
    .map(line => line.slice(spaces))
    .join("\n")
    .trim();
}
625532
def unescape(self):
        
        for i, k in enumerate(self._html_escape_table):
            v = self._html_escape_table[k]
            self.obj = self.obj.replace(v, k)

        return self._wrap(self.obj)
716538
def _unescape_str(value):
        

        if isinstance(value, int):
            return "%d" % value
        value = value.replace(r"\\", "\\")
        for i, j in ts3_escape.items():
            value = value.replace(j, i)
        return value
583009
private static String unescape( String str, String encoding )
    {
        //We cannot unescape '+' to space because '+' is allowed in the file name
        //str = str.replace('+', ' ');
        
        //if the str does not contain "%", we don't need to do anything
        if ( str.indexOf( '%' ) < 0 )
        {
            return str;
        }

        if ( encoding == null || encoding.length() == 0 )
        {
            encoding = WLS_DEFAULT_ENCODING;
        }
        
        // Do not assume String only contains ascii.  str.length() <= str.getBytes().length
        int out = 0;

        byte[] strbytes = str.getBytes();
        int len = strbytes.length;

        boolean foundNonAscii = false;
        for ( int in = 0; in < len; in++, out++ )
        {
            if ( strbytes[in] == '%' && ( in + 2 < len ) )
            {
                if ( Hex.isHexChar( strbytes[in + 1] ) &&
                     Hex.isHexChar( strbytes[in + 2] ) )
                {
                    strbytes[out] =
                    ( byte ) ( ( Hex.hexValueOf( strbytes[in + 1] ) << 4 ) +
                               ( Hex.hexValueOf( strbytes[in + 2] ) << 0 ) );
                    in += 2;
                    continue;
                }
            }
            // IE takes non-ASCII URLs. We use the default encoding
            // if non-ASCII characters are contained in URLs.
            if ( !foundNonAscii &&
                 ( strbytes[in] <= 0x1f || strbytes[in] == 0x7f ) )
            {
                encoding = System.getProperty( "file.encoding" );
                foundNonAscii = true;
            }
            strbytes[out] = strbytes[in];
        }

        return newString( strbytes, 0, out, encoding );  // was:  BytesToString.newString(...)
    }
800798
def _unescape(self, value):
    '''
    
    '''
    if isinstance(value, (str,unicode)):
      return value.replace(self._escape_character, '.')
    elif isinstance(value, dict):
      return { self._unescape(k) : self._unescape(v) for k,v in value.items() }
    elif isinstance(value, list):
      return [ self._unescape(v) for v in value ]
    return value
913079
public static String unescape(String str, char escape)
    {
        if (str == null) {
            return "";
        }
        StringBuffer buf = new StringBuffer();
        char[] array = str.toCharArray();
        boolean escaped = false;
        for (int i = 0; i < array.length; i++) {
            char ch = array[i];
            if (escaped) {
                buf.append(ch);
                escaped = false;
            } else {
                escaped = (ch == escape);
                if (!escaped) {
                    buf.append(ch);
                }
            }
        }
        return buf.toString();
    }
858735
function unescapeHtml(str) {
        angular.forEach(_escapeHtmlChars, function (value, key) {
            var regex = new RegExp(value, "g");
            str = str.replace(regex, key);
        });
        str = str.replace(/&gt;/g, ">");
        return str;
    }
414882
String unescapeString(String st) {

        StringBuilder sb = new StringBuilder(st.length());

        for (int i = 0; i < st.length(); i++) {
            char ch = st.charAt(i);
            if (ch == '\\') {
                char nextChar = (i == st.length() - 1) ? '\\' : st.charAt(i + 1);
                switch (nextChar) {
                case '\\':
                    ch = '\\';
                    break;
                case 'b':
                    ch = '\b';
                    break;
                case 'f':
                    ch = '\f';
                    break;
                case 'n':
                    ch = '\n';
                    break;
                case 'r':
                    ch = '\r';
                    break;
                case 't':
                    ch = '\t';
                    break;
                /*case '\"':
                    ch = '\"';
                    break;
                case '\'':
                    ch = '\'';
                    break;*/
                // Hex Unicode: u????
                case 'u':
                    if (i >= st.length() - 5) {
                        ch = 'u';
                        break;
                    }
                    int code = Integer.parseInt(
                            "" + st.charAt(i + 2) + st.charAt(i + 3) + st.charAt(i + 4) + st.charAt(i + 5), 16);
                    sb.append(Character.toChars(code));
                    i += 5;
                    continue;
                }
                i++;
            }
            sb.append(ch);
        }
        return sb.toString();
    }
755520
public static String unescape(String input, char escapeCharacter) {
      if (input == null) {
         return null;
      }
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i < input.length(); ) {
         if (input.charAt(i) == escapeCharacter) {
            builder.append(input.charAt(i + 1));
            i = i + 2;
         } else {
            builder.append(input.charAt(i));
            i++;
         }
      }
      return builder.toString();
   }
661055
public static String unescape(String htmlStr) {
		if (StrUtil.isBlank(htmlStr)) {
			return htmlStr;
		}
		return htmlStr.replace(StrUtil.HTML_APOS, "'")//
				.replace("&#039;", "'")//
				.replace("&#39;", "'")//
				.replace(StrUtil.HTML_LT, "<")//
				.replace(StrUtil.HTML_GT, ">")//
				.replace(StrUtil.HTML_QUOTE, "\"")//
				.replace(StrUtil.HTML_AMP, "&")//
				.replace(StrUtil.HTML_NBSP, " "//
		);
	}
882583
protected static String unescape(String value) {

        value = CmsStringUtil.substitute(value, "\\,", ",");
        value = CmsStringUtil.substitute(value, "\\=", "=");
        value = CmsStringUtil.substitute(value, "\\\\", "\\");

        return value;
    }
974875
public static String unescape(String s) {
        int len = s.length();
        StringBuffer b = new StringBuffer();
        for (int i = 0; i < len; ++i) {
            char c = s.charAt(i);
            if (c == '+') {
                c = ' ';
            } else if (c == '%' && i + 2 < len) {
                int d = JSONTokener.dehexchar(s.charAt(i + 1));
                int e = JSONTokener.dehexchar(s.charAt(i + 2));
                if (d >= 0 && e >= 0) {
                    c = (char)(d * 16 + e);
                    i += 2;
                }
            }
            b.append(c);
        }
        return b.toString();
    }