From: mchampan Date: Wed, 2 Aug 2006 15:15:45 +0000 (+0000) Subject: String issue fix in ZF. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=01e6afe2cdc5b45157e3afcbfdb519e97ea305eb;p=moodle.git String issue fix in ZF. --- diff --git a/search/Zend/Search/Lucene/Field.php b/search/Zend/Search/Lucene/Field.php index 4612d59ca4..5a18fcfc46 100644 --- a/search/Zend/Search/Lucene/Field.php +++ b/search/Zend/Search/Lucene/Field.php @@ -34,8 +34,6 @@ * @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -//require_once('EncodingConverter.php'); - class Zend_Search_Lucene_Field { public $kind; @@ -48,33 +46,20 @@ class Zend_Search_Lucene_Field public $isBinary = false; public $storeTermVector = false; - + public $boost = 1.0; public function __construct($name, $stringValue, $isStored, $isIndexed, $isTokenized, $isBinary = false) { - $this->name = $name; - - if (!$isBinary) { - /* - $econv = new EncodingConverter(mb_detect_encoding($stringValue), 'ASCII//TRANSLIT'); - $this->stringValue = $econv->convert($stringValue); - - if ($econv->getLastError()) { - echo "Error: ".$econv->getLastError(); - echo "
"; - echo "x".$stringValue."x"; - exit(); - } else { - }*/ - + $this->name = $name; + + if (!$isBinary) { /** * @todo Correct UTF-8 string should be required in future * Until full UTF-8 support is not completed, string should be normalized to ANSII encoding */ - - $this->stringValue = iconv('ISO-8859-1', 'ASCII//TRANSLIT', $stringValue); - //$this->stringValue = iconv(mb_detect_encoding($stringValue), 'ASCII//TRANSLIT', $stringValue); + $this->stringValue = iconv(mb_detect_encoding($stringValue), 'ASCII//TRANSLIT', $stringValue); + //$this->stringValue = iconv('', 'ASCII//TRANSLIT', $stringValue); } else { $this->stringValue = $stringValue; }