%%
%% This is file `l3str-esc-url.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3str-convert.dtx  (with options: `url')
%% 
%% Copyright (C) 2011-2017 The LaTeX3 Project
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This file is part of the "l3experimental bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%% 
%% File: l3str-convert.dtx Copyright (C) 2013-2018 The LaTeX3 Project
\cs_set_protected:Npn \__str_tmp:w #1#2#3
  {
    \cs_new_protected:cpn { __str_convert_unescape_#2: }
      {
        \group_begin:
          \flag_clear:n { str_byte }
          \flag_clear:n { str_error }
          \int_set:Nn \tex_escapechar:D { 92 }
          \tl_gset:Nx \g__str_result_tl
            {
              \exp_after:wN #3 \g__str_result_tl
                #1 ? { ? \__prg_break: }
              \__prg_break_point:
            }
          \__str_if_flag_error:nnx { str_byte } { non-byte } { #2 }
          \__str_if_flag_error:nnx { str_error } { unescape-#2 } { }
        \group_end:
      }
    \cs_new:Npn #3 ##1#1##2##3
      {
        \__str_filter_bytes:n {##1}
        \use_none:n ##3
        \__str_output_byte:w "
          \__str_hexadecimal_use:NTF ##2
            {
              \__str_hexadecimal_use:NTF ##3
                { }
                {
                  \flag_raise:n { str_error }
                  * 0 + `#1 \use_i:nn
                }
            }
            {
              \flag_raise:n { str_error }
              0 + `#1 \use_i:nn
            }
        \__str_output_end:
        \use_i:nnn #3 ##2##3
      }
    \__kernel_msg_new:nnnn { str } { unescape-#2 }
      { String~invalid~in~escaping~'#2'. }
      {
        LaTeX~came~across~the~escape~character~'#1'~not~followed~by~
        two~hexadecimal~digits.~This~is~invalid~in~the~escaping~'#2'.
      }
  }
\exp_after:wN \__str_tmp:w \c_percent_str { url }
  \__str_unescape_url_loop:wNN
\cs_new_protected:Npn \__str_convert_escape_url:
  { \__str_convert_gmap:N \__str_escape_url_char:N }
\cs_new:Npn \__str_escape_url_char:N #1
  {
    \__str_if_escape_url:NTF #1 {#1}
      { \c_percent_str \__str_output_hexadecimal:n { `#1 } }
  }
\prg_new_conditional:Npnn \__str_if_escape_url:N #1 { TF }
  {
    \if_int_compare:w `#1 < "41 \exp_stop_f:
      \__str_if_contains_char:nNTF { "-.<> } #1
        \prg_return_true: \prg_return_false:
    \else:
      \if_int_compare:w `#1 > "7E \exp_stop_f:
        \prg_return_false:
      \else:
        \__str_if_contains_char:nNTF { [ ] } #1
          \prg_return_false: \prg_return_true:
      \fi:
    \fi:
  }
%% 
%%
%% End of file `l3str-esc-url.def'.
