Monthly Archives: 2月 2012

Thinkpad T410i音量快捷键调整音量事屏幕不显示音量大小的数字

去年将T410自带的win7家庭版升级到旗舰版后,音量、麦克风等调节时,屏幕均不显示提示信息,用起来很别捏,网上搜索了一下大部分都是说驱动未更新所致。

今天更新了一下ThinkPad ACPI电源管理驱动(Windows 7/Vista/XP)集成System Interface的Hotkey驱动程序(Windows 7/Vista/XP 32-bit,64-bit/2000) 驱动后,重启电脑,提示信息又回来了~

 

 

无线局域网拷贝速度为何只有2M?

周五佳哥问到局域网大文件拷贝速度慢的问题,以前也没特别在意局域网拷贝的速度问题,今天测试了一下发现,有线网到无线网速度只有2.4M左右,后来改为11n,大概是之前的2-3倍,速度可以到7M,基本和有线网的速度差不多了。但反向复制文件,速度只有5M,无论如何测试,也提升不到7M,原因未知。

 

 

squirrelmail汉化

[root@server ~]# cd /var/www/html/squirrelmail-1.4.22/config
[root@server config]# ./conf.pl
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit
Command >> 10
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : en_US
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 1
SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.
[en_US]: zh_CN
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 2
This option controls what character set is used when sending
mail and when sending HTML to the browser.
This option is used only when default language is 'en_US'.
[iso-8859-1]: gb2312
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : gb2312
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> s
Data saved in config.php
Press enter to continue...
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : gb2312
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> q
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!

 

cd /var/www/html/squirrelmail/config
./conf.pl
选择10 设置语言为zh_CN
默认字符集为gb2312
保存退出,重新刷新webmail页面,就成中文了
但是登录进入后,左边的Drafts,sent,trash还是英文
修改/var/www/html/squirrelmail/local/zh_CN/LC_MESSAGES/squirrelmail.po,
增加msgid和msgstr,
修改完毕后,用 msgfmt -o squirrelmail.mo squirrelmail.po 来格式化一下。

vtiger CRM 5.3截取中文字符串出现乱码的解决方法

打开文件/include/utils/ListViewUtils.php

找到第4283行,红色部分为新增代码,修改如下:

}elseif(strlen($field_val) > $listview_max_textlength) {
 if($default_charset == 'UTF-8'){
 $temp_val = mb_substr($field_val, 0, $listview_max_textlength, $default_charset).'...';
 }else{
 $temp_val = substr(preg_replace("/(<\/?)(\w+)([^>]*>)/i","",$field_val),0,$listview_max_textlength).'...';
 }
 }
 } else {

注意:请确保php开启了mb_substr函数支持。

在php.ini中找到“;extension=php_mbstring.dll”去掉前面的分号“;”,然后重启服务即可

vtigercrm数据导出csv乱码修复

vtigerCRM 5.3 导入导出数据文件CSV中文乱码主要是vtigerCRM只支持UTF-8和ISO-8859-1编码,所以我们用Windows平台打开时就发生乱码,为了在Windows中不产生乱码必须将CSV文件的编码变成GBK或者使用excel的数据导入功能,选择utf-8编码打开即可。

 

导入数据文件CSV中文乱码修正

在Smarty/templates/ImportStep1.tpl中的第99行插入<option value=”GBK”>GBK</option>

<select name="format" class="small">
<!-- value must be a known format for mb_convert_encoding() -->
 <option value="GBK">GBK</option> // <<插入一行
 <option value="ISO-8859-1">ISO-8859-1</option>
 <option value="UTF-8">UTF-8</option>
</select>

导出数据文件CSV中文乱码修正

修改include/utils/export.php中的第208,232和240行

/** Output header information */
 echo iconv("UTF-8", "GBK", $header); //原来: echo $header;

 

/** Output each row information */
 echo iconv("UTF-8", "gbk", $line); //原来: echo $line;
 }
 $log->debug("Exiting export method ...");
 return true;
}

 

/** Send the output header and invoke function for contents output */
header("Content-Disposition:attachment;filename={$_REQUEST['module']}.csv");
header("Content-Type:text/csv;charset=gbk"); 
//原来: header("Content-Type:text/csv;charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
header("Cache-Control: post-check=0, pre-check=0", false );