String issue fix in ZF.
authormchampan <mchampan>
Wed, 2 Aug 2006 15:15:45 +0000 (15:15 +0000)
committermchampan <mchampan>
Wed, 2 Aug 2006 15:15:45 +0000 (15:15 +0000)
search/Zend/Search/Lucene/Field.php

index 4612d59..5a18fcf 100644 (file)
@@ -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 "<br>";
-                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;
         }