LittleCloud's Java World

          Live and learn.
          posts - 18, comments - 29, trackbacks - 0, articles - 1
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          安裝好TestLink 和Mantis后,所有配置好以后,發(fā)現(xiàn)測(cè)試相關(guān)的BUG標(biāo)題中文是亂碼,網(wǎng)上找了若干文章沒有解決,自己摸索出一下方法。

          Mantis版本: 1.1.0(RC2)
          TestLink版本:1.7.1
          PHP版本:5.2.5
          MySQL版本:5.0.22

          需要修改TestLink的文件:lib\bugtracking\int_mantis.php

           function getBugSummaryString($id)
           {
            if (!$this->isConnected())
             return false;
            
            //$this->m_dbConnection->aaa();
            $this->m_dbConnection->exec_query("set names 'GB2312'");  //<-新增加的
            
            $status = null;
            // 20070302 - {$this->m_dbName}.mantis_bug_table -> mantis_bug_table
            // Problems with MS-SQL
            $query = "Select summary FROM mantis_bug_table Where id='" . $id."'";
            
            $result = $this->m_dbConnection->exec_query($query);
            if ($result)
            {
             $summary = $this->m_dbConnection->fetch_array($result);

             // 20070302 - BUGID - on MS-SQL fetch_array() does not returns numeric indexes, then
             //                    only choice is accessing my field name (IMHO better)
             if ($summary)
              $summary = iconv("GB2312",TL_TPL_CHARSET,$summary['summary']);//<-修改的
             else
              $summary = null;
            }
            return $summary;
           }



          源文出自:http://www.joyblog.cn/article.asp?id=463

          評(píng)論

          # re: Testlink與Mantis集成后,亂碼解決辦法  回復(fù)  更多評(píng)論   

          2011-12-30 10:23 by testlink
          按你這種方法還是沒有解決,我用的是testlink1.9.3,不知道什么原因
          主站蜘蛛池模板: 佛教| 赫章县| 东丰县| 静安区| 贺州市| 成武县| 名山县| 平定县| 南昌市| 保山市| 南和县| 耒阳市| 黔东| 晋州市| 闸北区| 株洲县| 莱西市| 方城县| 宝山区| 二连浩特市| 云林县| 广元市| 南澳县| 武鸣县| 长武县| 余干县| 阳泉市| 灵山县| 襄垣县| 宝兴县| 许昌县| 中西区| 宁明县| 呼图壁县| 巴中市| 隆德县| 文安县| 商河县| 双牌县| 白水县| 靖边县|