Chinaunix首页 | 论坛 | 博客
  • 博客访问: 293378
  • 博文数量: 155
  • 博客积分: 1688
  • 博客等级: 上尉
  • 技术积分: 1560
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-17 08:06
文章分类
文章存档

2011年(16)

2009年(137)

2008年(2)

分类: LINUX

2009-06-06 02:50:22

java环境下中文乱码问题,看来是个通病,我也看了很多帖子,仍然走了不少弯路,在此总结出来,让后来者参考,如果真起到作用,我将非常高兴。
平台:Mandriva 2006.0,JAVA版本:jdk1.5.0_07
将Windows下的字体文件simsun.ttc拷贝到/usr/share/fonts/zh_CN,我的目录下本没有该目录,仅有/usr/share/fonts/zh_TW,创建zh_CN目录。
将JAVA_HOME/jre/lib/下fontconfig.*开头的文件全部删除或备份起来,改成附件的文件(fontconfig.properties):
为方便,我也将内容贴在这里:
# @(#)linux.fontconfig.Sun.properties 1.5 03/11/14
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
#

# Version

version=1

# Component Font Mappings

allfonts.chinese-gbk=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gbk-0
allfonts.chinese-gb2312=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gb2312.1980-0
allfonts.chinese-cn-iso10646=-misc-simsun-medium-r-normal--*-%d-*-*-p-*-iso10646-1
allfonts.chinese-big5=-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-big5-0
allfonts.chinese-tw-iso10646=-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-iso10646-1
allfonts.chinese-big5hkscs=-misc-fzheiti-medium-r-normal--*-%d-*-*-p-*-big5hkscs-0
allfonts.lucida=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1

serif.plain.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.plain.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.plain.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.plain.latin-1=-b&h-lucidabright-medium-r-normal--*-%d-*-*-p-*-iso8859-1
serif.plain.latin-1.motif=-b&h-luxi serif-medium-r-normal--*-%d-*-*-p-*-iso8859-1

serif.bold.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.bold.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.bold.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.bold.latin-1=-b&h-lucidabright-demibold-r-normal--*-%d-*-*-p-*-iso8859-1
serif.bold.latin-1.motif=-b&h-luxi serif-bold-r-normal--*-%d-*-*-p-*-iso8859-1

serif.italic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.italic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.italic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.italic.latin-1=-b&h-lucidabright-medium-i-normal--*-%d-*-*-p-*-iso8859-1
serif.italic.latin-1.motif=-b&h-luxi serif-medium-i-normal--*-%d-*-*-p-*-iso8859-1

serif.bolditalic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
serif.bolditalic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
serif.bolditalic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
serif.bolditalic.latin-1=-b&h-lucidabright-demibold-i-normal--*-%d-*-*-p-*-iso8859-1
serif.bolditalic.latin-1.motif=-b&h-luxi serif-bold-i-normal--*-%d-*-*-p-*-iso8859-1

sansserif.plain.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.plain.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.plain.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1

sansserif.bold.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.bold.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.bold.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1

sansserif.italic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.italic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.italic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1

sansserif.bolditalic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
sansserif.bolditalic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
sansserif.bolditalic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
sansserif.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1
sansserif.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1

monospaced.plain.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.plain.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.plain.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1

monospaced.bold.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.bold.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.bold.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1

monospaced.italic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.italic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.italic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1

monospaced.bolditalic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
monospaced.bolditalic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
monospaced.bolditalic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
monospaced.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1
monospaced.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1

dialog.plain.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.plain.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.plain.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.plain.latin-1.motif=-b&h-luxi sans-medium-r-normal--*-%d-*-*-p-*-iso8859-1

dialog.bold.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.bold.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.bold.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.bold.latin-1=-b&h-lucidasans-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.bold.latin-1.motif=-b&h-luxi sans-bold-r-normal--*-%d-*-*-p-*-iso8859-1

dialog.italic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.italic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.italic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.italic.latin-1=-b&h-lucidasans-medium-i-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.italic.latin-1.motif=-b&h-luxi sans-medium-i-normal--*-%d-*-*-p-*-iso8859-1

dialog.bolditalic.japanese-x0201=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialog.bolditalic.japanese-x0208=-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialog.bolditalic.korean=-hwan-baekmuk gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialog.bolditalic.latin-1=-b&h-lucidasans-bold-i-normal-sans-*-%d-*-*-p-*-iso8859-1
dialog.bolditalic.latin-1.motif=-b&h-luxi sans-bold-i-normal--*-%d-*-*-p-*-iso8859-1

dialoginput.plain.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.plain.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.plain.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.plain.latin-1=-b&h-lucidatypewriter-medium-r-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.plain.latin-1.motif=-b&h-luxi mono-medium-r-normal--*-%d-*-*-m-*-iso8859-1

dialoginput.bold.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.bold.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.bold.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.bold.latin-1=-b&h-lucidatypewriter-bold-r-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.bold.latin-1.motif=-b&h-luxi mono-bold-r-normal--*-%d-*-*-m-*-iso8859-1

dialoginput.italic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.italic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.italic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.italic.latin-1=-b&h-lucidatypewriter-medium-i-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.italic.latin-1.motif=-b&h-luxi mono-medium-i-normal--*-%d-*-*-m-*-iso8859-1

dialoginput.bolditalic.japanese-x0201=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0
dialoginput.bolditalic.japanese-x0208=-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0
dialoginput.bolditalic.korean=-hwan-baekmuk batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0
dialoginput.bolditalic.latin-1=-b&h-lucidatypewriter-bold-i-normal-sans-*-%d-*-*-m-*-iso8859-1
dialoginput.bolditalic.latin-1.motif=-b&h-luxi mono-bold-i-normal--*-%d-*-*-m-*-iso8859-1

# Search Sequences

sequence.allfonts=latin-1
sequence.allfonts.Big5=latin-1,chinese-big5
sequence.allfonts.Big5-HKSCS=latin-1,chinese-big5hkscs
sequence.allfonts.GB18030=latin-1,chinese-gbk,chinese-cn-iso10646
sequence.allfonts.GBK=latin-1,chinese-gbk
sequence.allfonts.GB2312=latin-1,chinese-gb2312
sequence.allfonts.EUC-KR=latin-1,korean
sequence.allfonts.x-euc-jp-linux=latin-1,japanese-x0201,japanese-x0208
sequence.allfonts.UTF-8.ko.KR=latin-1,korean,japanese-x0208,japanese-x0201,chinese-gbk
sequence.allfonts.UTF-8.ja.JP=latin-1,japanese-x0208,japanese-x0201,chinese-gbk,korean
sequence.allfonts.UTF-8.zh.CN=latin-1,chinese-cn-iso10646,japanese-x0208,japanese-x0201,korean
sequence.allfonts.UTF-8.zh.TW=latin-1,chinese-tw-iso10646,japanese-x0208,japanese-x0201,korean
sequence.allfonts.UTF-8.zh.HK=latin-1,chinese-tw-iso10646,japanese-x0208,japanese-x0201,korean

sequence.fallback=lucida,chinese-big5,chinese-gbk,japanese-x0208,korean

# Exclusion Ranges
exclusion.japanese-x0201=0390-03d6,2200-22ef,2701-27be
exclusion.japanese-x0208=0390-03d6,2200-22ef,2701-27be

# Font File Names

filename.-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-big5-0=/usr/share/fonts/zh_CN/ming_big5.ttf
filename.-misc-fzheiti-medium-r-normal--*-%d-*-*-p-*-big5hkscs-0=/usr/share/fonts/zh_CN/ming_big5.ttf
filename.-misc-fzmingti-medium-r-normal--*-%d-*-*-p-*-iso10646-1=/usr/share/fonts/zh_CN/ming_big5.ttf
filename.-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gbk-0=/usr/share/fonts/zh_CN/simsun.ttc
filename.-misc-simsun-medium-r-normal--*-%d-*-*-p-*-gb2312.1980-0=/usr/share/fonts/zh_CN/simsun.ttc
filename.-misc-simsun-medium-r-normal--*-%d-*-*-p-*-iso10646-1=/usr/share/fonts/zh_CN/simsun.ttc
filename.-hwan-baekmuk_batang-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0=/usr/share/fonts/zh_CN/batang.ttf
filename.-hwan-baekmuk_gulim-medium-r-normal--*-%d-*-*-p-*-ksc5601.1987-0=/usr/share/fonts/zh_CN/gulim.ttf
filename.-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/zh_CN/kochi-gothic.ttf
filename.-kochi-gothic-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/share/fonts/zh_CN/kochi-gothic.ttf
filename.-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0208.1983-0=/usr/share/fonts/zh_CN/kochi-mincho.ttf
filename.-kochi-mincho-medium-r-normal--*-%d-*-*-c-*-jisx0201.1976-0=/usr/share/fonts/zh_CN/kochi-mincho.ttf

# AWT X11 font paths
awtfontpath.chinese-big5=/usr/share/fonts/zh_CN
awtfontpath.chinese-big5hkscs=/usr/share/fonts/zh_CN
awtfontpath.chinese-gb2312=/usr/share/fonts/zh_CN
awtfontpath.chinese-gbk=/usr/share/fonts/zh_CN
awtfontpath.chinese-chinese-cn-iso10646=/usr/share/fonts/zh_CN
awtfontpath.chinese-chinese-tw-iso10646=/usr/share/fonts/zh_CN
awtfontpath.japanese-x0201=/usr/share/fonts/zh_CN
awtfontpath.japanese-x0208=/usr/share/fonts/zh_CN
awtfontpath.korean=/usr/share/fonts/zh_CN

阅读(1091) | 评论(0) | 转发(0) |
0

上一篇:CentOS的安全配置

下一篇:tomcat 性能优化

给主人留下些什么吧!~~