original_string: public function getEncoding()
      {
          $content = $this->getHeaderLine('content-type');
          if (!$content) {
              return null;
          }
          preg_match('/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i', $content, $matches);
          if (empty($matches[1])) {
              return null;
          }
  
          return $matches[1];
      }
code: public function getEncoding()
      {
          $content = $this->getHeaderLine('content-type');
          if (!$content) {
              return null;
          }
          preg_match('/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i', $content, $matches);
          if (empty($matches[1])) {
              return null;
          }
  
          return $matches[1];
      }
code_tokens: public function getEncoding ( ) { $ content = $ this -> getHeaderLine ( 'content-type' ) ; if ( ! $ content ) { return null ; } preg_match ( '/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i' , $ content , $ matches ) ; if ( empty ( $ matches [ 1 ] ) ) { return null ; } return $ matches [ 1 ] ; }
docstring: Get the encoding if it was set.
  
  @return string|null
docstring_tokens: Get the encoding if it was set .