日语字符在Android TextView和Buttons中显示奇怪的间距

时间:2011-02-22 20:38:49

标签: android utf-8 internationalization

我正在尝试将Android应用程序本地化为日语。我放入日文字符串xml文件,除了带有两个小破折号的Katakana字符或右上角的小圆圈外,一切都很好。对于这些字符,显示占用2个完整字符的宽度。

这是一个简单的例子,显示片假名中“网站”一词的间距问题:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
>
    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="ウェブサイト"       
        android:typeface="normal"/>
</LinearLayout>

当它显示在手机上时,第3个角色会占用额外的空间。任何想法出了什么问题?

2 个答案:

答案 0 :(得分:1)

尝试更改字符“ブ” - &gt; “ブ”。
第三个字符在UTF-8中不使用普通日语。

答案 1 :(得分:0)

尝试将字符串外部化为strings.xml。这样做我没有这个问题。