Loading lib/strings.nix +5 −1 Original line number Diff line number Diff line Loading @@ -998,7 +998,11 @@ rec { ::: */ escapeC = list: replaceStrings list (map (c: "\\x${toLower (lib.toHexString (charToInt c))}") list); escapeC = list: replaceStrings list ( map (c: "\\x${fixedWidthString 2 "0" (toLower (lib.toHexString (charToInt c)))}") list ); /** Escape the `string` so it can be safely placed inside a URL Loading lib/tests/misc.nix +2 −2 Original line number Diff line number Diff line Loading @@ -851,8 +851,8 @@ runTests { }; testEscapeC = { expr = strings.escapeC [ " " ] "Hello World"; expected = "Hello\\x20World"; expr = strings.escapeC [ "\n" " " ] "Hello World\n"; expected = "Hello\\x20World\\x0a"; }; testEscapeURL = testAllTrue [ Loading Loading
lib/strings.nix +5 −1 Original line number Diff line number Diff line Loading @@ -998,7 +998,11 @@ rec { ::: */ escapeC = list: replaceStrings list (map (c: "\\x${toLower (lib.toHexString (charToInt c))}") list); escapeC = list: replaceStrings list ( map (c: "\\x${fixedWidthString 2 "0" (toLower (lib.toHexString (charToInt c)))}") list ); /** Escape the `string` so it can be safely placed inside a URL Loading
lib/tests/misc.nix +2 −2 Original line number Diff line number Diff line Loading @@ -851,8 +851,8 @@ runTests { }; testEscapeC = { expr = strings.escapeC [ " " ] "Hello World"; expected = "Hello\\x20World"; expr = strings.escapeC [ "\n" " " ] "Hello World\n"; expected = "Hello\\x20World\\x0a"; }; testEscapeURL = testAllTrue [ Loading