Skip to content
FutureBlitz

    Install

    Import std.text.encoding

    Percent

    std.text.encoding

    struct

    Public Struct Percent

    Percent-encoding, which a URL's parts are in: each byte of text's UTF-8, but for the letters, digits, "-", ".", "_", and "~", as "%" and two hex digits.

    Examples

    Expect(Percent.Encode("a b&c") == "a%20b%26c")
    Expect(Percent.Decode("a%20b%26c") == "a b&c")

    std/text/encoding.fb, line 373

    • Public Static Method Encode(text: String, keep: String = ""): String static method #

      text percent-encoded, with each ASCII character in keep, like "/" for a path, kept as it is.

    • Public Static Method EncodeBytes(bytes: UInt8[], keep: String = ""): String static method #

      bytes percent-encoded, with each byte of an ASCII character in keep kept as it is.

    • Public Static Method Decode(text: String): String? static method #

      The text percent-encoded text stands for, or Null when a "%" isn't followed by two hex digits, or the bytes aren't UTF-8.

    • Public Static Method DecodeBytes(text: String): UInt8[]? static method #

      The bytes percent-encoded text stands for, or Null when a "%" isn't followed by two hex digits.

    Report an issue with this page or with FutureBlitz on GitHub.