original_string: public static function encode_fn($file,$safe=true)
      {
          if($safe && preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){
              return $file;
          }
          $file = urlencode($file);
          $file = str_replace('%2F','/',$file);
          return $file;
      }
code: public static function encode_fn($file,$safe=true)
      {
          if($safe && preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){
              return $file;
          }
          $file = urlencode($file);
          $file = str_replace('%2F','/',$file);
          return $file;
      }
code_tokens: public static function encode_fn ( $ file , $ safe = true ) { if ( $ safe && preg_match ( '#^[a-zA-Z0-9/_\-.%]+$#' , $ file ) ) { return $ file ; } $ file = urlencode ( $ file ) ; $ file = str_replace ( '%2F' , '/' , $ file ) ; return $ file ; }
docstring: URL-Encode a filename to allow unicodecharacters
  
  Slashes are not encoded
  
  When the second parameter is true the string will
  be encoded only if non ASCII characters are detected -
  This makes it safe to run it multiple times on the
  same string (default is true)
  
  @author Andreas Gohr <andi@splitbrain.org>
  @see    urlencode
docstring_tokens: URL - Encode a filename to allow unicodecharacters