original_string: public  function convert($str)
  	{
  		if ($this->from != $this->to)
  		{
  			$str = iconv($this->from, $this->to, $str);
  		}
  
  		if ($str === false)
  		{
  			// the convertion was a failure
  			throw new Exception('The convertion from "'.$this->from.'" to "'.$this->to.'" was a failure.');
  		}
  
  		// deal with BOM issue for utf-8 text
  		if ($this->to == 'UTF-8')
  		{
  			if (substr($str, 0, 3) == "\xef\xbb\xbf")
  			{
  				$str = substr($str, 3);
  			}
  			if (substr($str, -3, 3) == "\xef\xbb\xbf")
  			{
  				$str = substr($str, 0, -3);
  			}
  		}
  
  		return $str;
  	}
code: public  function convert($str)
  	{
  		if ($this->from != $this->to)
  		{
  			$str = iconv($this->from, $this->to, $str);
  		}
  
  		if ($str === false)
  		{
  			// the convertion was a failure
  			throw new Exception('The convertion from "'.$this->from.'" to "'.$this->to.'" was a failure.');
  		}
  
  		// deal with BOM issue for utf-8 text
  		if ($this->to == 'UTF-8')
  		{
  			if (substr($str, 0, 3) == "\xef\xbb\xbf")
  			{
  				$str = substr($str, 3);
  			}
  			if (substr($str, -3, 3) == "\xef\xbb\xbf")
  			{
  				$str = substr($str, 0, -3);
  			}
  		}
  
  		return $str;
  	}
code_tokens: public function convert ( $ str ) { if ( $ this -> from != $ this -> to ) { $ str = iconv ( $ this -> from , $ this -> to , $ str ) ; } if ( $ str === false ) { // the convertion was a failure throw new Exception ( 'The convertion from "' . $ this -> from . '" to "' . $ this -> to . '" was a failure.' ) ; } // deal with BOM issue for utf-8 text if ( $ this -> to == 'UTF-8' ) { if ( substr ( $ str , 0 , 3 ) == "\xef\xbb\xbf" ) { $ str = substr ( $ str , 3 ) ; } if ( substr ( $ str , - 3 , 3 ) == "\xef\xbb\xbf" ) { $ str = substr ( $ str , 0 , - 3 ) ; } } return $ str ; }
docstring: Attempts to convert the string to the proper charset.
  
  @return string
docstring_tokens: Attempts to convert the string to the proper charset .