field = (escaped / non-escaped)
963757
String readField() throws IOException {
		int c;
		while (true) {
			c = reader.read();
			if (c == -1) {
				return "";
			} else if (!Character.isWhitespace(c)) {
				reader.unread(c);
				break;
			} else if (c == '\n') {
				reader.unread(c);
				return "";
			}
		}
		if (c == QUOTE_CHAR) {
			return readEscaped();
		} else {
			return readNonEscaped();
		}
	}
1028919
def _escape_str(value):
        

        if isinstance(value, int):
            return "%d" % value
        value = value.replace("\\", r'\\')
        for i, j in ts3_escape.items():
            value = value.replace(i, j)
        return value
1041140
def escape(self, varname, value):
        
        f = self.escape_funcs.get(varname)
        return f(value) if f else value
453571
def _normalize_field_name(value):
    
    # Replace non word/letter character
    return_value = re.sub(r'[^\w\s-]+', '', value)
    # Replaces whitespace with underscores
    return_value = re.sub(r'\s+', '_', return_value)
    return return_value.lower()
434381
private static String escapeXml (String nonEscapedXmlStr) {
        StringBuilder escapedXML = new StringBuilder();
        for (int i = 0; i < nonEscapedXmlStr.length(); i++) {
            char c = nonEscapedXmlStr.charAt(i);
            switch (c) {
                case '<':
                    escapedXML.append("&lt;");
                    break;
                case '>':
                    escapedXML.append("&gt;");
                    break;
                case '\"':
                    escapedXML.append("&quot;");
                    break;
                case '&':
                    escapedXML.append("&amp;");
                    break;
                case '\'':
                    escapedXML.append("&apos;");
                    break;
                default:
                    if (c > 0x7e) {
                        escapedXML.append("&#" + ((int) c) + ";");
                    } else {
                        escapedXML.append(c);
                    }
            }
        }
        return escapedXML.toString();
    }
1054898
def convert_field_value(type_, value):
    """"""
    if value == ".":
        return None
    elif type_ in ("Character", "String"):
        if "%" in value:
            for k, v in record.UNESCAPE_MAPPING:
                value = value.replace(k, v)
        return value
    else:
        try:
            return _CONVERTERS[type_](value)
        except ValueError:
            warnings.warn(
                ("{} cannot be converted to {}, keeping as " "string.").format(value, type_),
                CannotConvertValue,
            )
            return value
1312302
def input(self, field):
        
        try:
            desc = Get.TYPES[field]
            return input("{}|{}[{}]> ".format(
                field, "-" * (Get._LEN - len(field) - len(desc)), desc
            ))
        except KeyboardInterrupt:
            print()
            exit(0)
472636
public static String escape(String raw) {
        checkNotNull(raw, "raw");
        String escaped = raw;
        escaped = escaped.replaceAll(UNESCAPED_WILDCARD_REGEX, WILDCARD_ESCAPE);
        escaped = escapeSeparators(escaped);
        return escaped;
    }
865914
def escape(value):
    

    if isinstance(value, (tuple, list)):
        return "(" + ", ".join([escape(arg) for arg in value]) + ")"
    else:
        typ = by_python_type.get(value.__class__)
        if typ is None:
            raise InterfaceError(
                "Unsupported python input: %s (%s)" % (value, value.__class__)
            )

        return typ.to_sql(value)
715906
private StringBuilder appendAttributeValue(final String value, final StringBuilder buf) {
      if(value.contains("\"")) {
         buf.append("\'").append(escapeAttribute(value)).append("\'");
      } else if(value.contains(" ") || value.contains("\'") || value.contains("=")) {
         buf.append("\"").append(escapeAttribute(value)).append("\"");
      } else {
         buf.append(escapeAttribute(value));
      }
      return buf;
   }
784344
def escape(s):
    """"""
    if not isinstance(s, bytes):
        s = s.encode('utf-8')
    return quote(s, safe='~')
607725
def escape(value, quote=True):
    '''
    
    '''
    def escape_one(match):
        return SPECIAL_CHARS[match.group(0)]

    if isinstance(value, string_types):
        value = SPECIAL_CHARS_REGEX.sub(escape_one, value)
        if quote:
            value = "'" + value + "'"
    return text_type(value)
5822
private void escape(String value) {
        int n = value.length();
        int i = 0;
        for (int j = 0; j < n; ++j) {
            int k = ESCAPED_CHARS.indexOf(value.charAt(j));
            if (k >= 0) {
                if (i < j) {
                    append(value, i, j);
                }
                append(ESCAPE_SEQ[k]);
                i = j + 1;
            }
        }
        if (i < n) {
            append(value, i, n);
        }
    }
885899
function compareNumericField(field, a, b) {
    var nodeA = (a[1]);
    var nodeB = (b[1]);
    return nodeA[field] - nodeB[field];
  }
901390
public String getEscapedFieldDelimiter() {
        final String escaped;

        switch (fieldDelimiter) {
            case ';':
                escaped = "\\semi";
                break;

            case '\'':
                escaped = "\\quote";
                break;

            case ' ':
                escaped = "\\space";
                break;

            case '`':
                escaped = "\\apos";
                break;

            default:
                escaped = String.valueOf(fieldDelimiter);
        }

        return escaped;
    }
35840
function splitField(chunk, strict) {
  const field = String(chunk);
  const index = field.indexOf(':');

  if (index === -1) {
    throw new SyntaxError(`field separator is not found: "${field}"`);
  }

  const label = field.slice(0, index);
  const value = field.slice(index + 1);

  if (strict && !(0, _validator.isValidLabel)(label)) {
    throw new SyntaxError(`unexpected character of label: "${label}"`);
  }

  if (strict && !(0, _validator.isValidValue)(value)) {
    throw new SyntaxError(`unexpected character of value: "${value}"`);
  }

  return {
    label,
    value
  };
}
744890
function(field, rule) {
            var
              $field       = module.get.field(field.identifier),
              type         = rule.type,
              value        = $field.val(),
              isValid      = true,
              ancillary    = module.get.ancillaryValue(rule),
              ruleName     = module.get.ruleName(rule),
              ruleFunction = settings.rules[ruleName]
            ;
            if( !$.isFunction(ruleFunction) ) {
              module.error(error.noRule, ruleName);
              return;
            }
            // cast to string avoiding encoding special values
            value = (value === undefined || value === '' || value === null)
              ? ''
              : $.trim(value + '')
            ;
            return ruleFunction.call($field, value, ancillary);
          }