name static method

String name(
  1. String value
)

Implementation

static String name(String value) {
  final StringBuffer buffer = StringBuffer("/");
  for (final int code in value.codeUnits) {
    final bool regular = code > 0x20 && code < 0x7F && code != 0x23 && !UPdfSyntax.isDelimiter(code);
    if (regular) {
      buffer.writeCharCode(code);
    } else {
      buffer.write("#${code.toRadixString(16).padLeft(2, "0")}");
    }
  }
  return buffer.toString();
}