original_string: protected function encode(array $messages)
      {
          if ($this->encode) {
              foreach ($messages as $key => $message) {
                  if (($form = mb_detect_encoding($message)) != self::TARGET_ENCODING) {
                      $messages[$key] = mb_convert_encoding($message, self::TARGET_ENCODING, $form);
                  }
              }
          }
  
          return $messages;
      }
code: protected function encode(array $messages)
      {
          if ($this->encode) {
              foreach ($messages as $key => $message) {
                  if (($form = mb_detect_encoding($message)) != self::TARGET_ENCODING) {
                      $messages[$key] = mb_convert_encoding($message, self::TARGET_ENCODING, $form);
                  }
              }
          }
  
          return $messages;
      }
code_tokens: protected function encode ( array $ messages ) { if ( $ this -> encode ) { foreach ( $ messages as $ key => $ message ) { if ( ( $ form = mb_detect_encoding ( $ message ) ) != self :: TARGET_ENCODING ) { $ messages [ $ key ] = mb_convert_encoding ( $ message , self :: TARGET_ENCODING , $ form ) ; } } } return $ messages ; }
docstring: Encode messages.
  
  @param array $messages
  
  @return array
docstring_tokens: Encode messages .