如何在 Android 中呈现泰米尔语 unicode

2024-02-14

Okay,

所以我的问题是我有一个 XML 泰米尔语 (unicode) feed,我想获取它并将其显示在 Android 应用程序中。

当我尝试执行此操作时,由于 Android 没有对泰米尔语的本机支持,因此必须使用自定义字体。

但随后问题就出现了,因为 unicode 中的渲染完全不同。我该如何解决这个问题?


我是如何解决这个问题的

我首先在以下命令的帮助下将 unicode 映射到 Bamini 字体http://www.ucsc.cmb.ac.lk/ltrl/services/feconverter/ http://www.ucsc.cmb.ac.lk/ltrl/services/feconverter/.

然后只需用 Bamini 字符替换 unicode 字符即可。我将文本发送到该函数并使用 Bamini 字体显示它。

    public static String initialize(String text) {

    text = text.replace("ஸ்ரீ", "=");
    text = text.replace(",", ">");
    text = text.replace("ஜௌ", "n[s");
    text = text.replace("ஜோ", "N[h");
    text = text.replace("ஜொ", "n[h");
    text = text.replace("ஜா", "[h");
    text = text.replace("ஜி", "[p");
    text = text.replace("ஜீ", "[P");
    text = text.replace("ஜு", "[{");
    text = text.replace("ஜூ", "[_");
    text = text.replace("ஜெ", "n[");
    text = text.replace("ஜே", "N[");
    text = text.replace("ஜை", "i[");
    text = text.replace("ஜ்", "[;");
    text = text.replace("ஜ", "[");
    text = text.replace("கௌ", "nfs");
    text = text.replace("கோ", "Nfh");
    text = text.replace("கொ", "nfh");
    text = text.replace("கா", "fh");
    text = text.replace("கி", "fp");
    text = text.replace("கீ", "fP");
    text = text.replace("கு", "F");
    text = text.replace("கூ", "$");
    text = text.replace("கெ", "nf");
    text = text.replace("கே", "Nf");
    text = text.replace("கை", "if");
    text = text.replace("க்", "f;");
    text = text.replace("க", "f");
    text = text.replace("ஙௌ", "nqs");
    text = text.replace("ஙோ", "Nqh");
    text = text.replace("ஙொ", "nqh");
    text = text.replace("ஙா", "qh");
    text = text.replace("ஙி", "qp");
    text = text.replace("ஙீ", "qP");
    text = text.replace("ஙு", "*");
    text = text.replace("ஙூ", "*");
    text = text.replace("ஙெ", "nq");
    text = text.replace("ஙே", "Nq");
    text = text.replace("ஙை", "iq");
    text = text.replace("ங்", "q;");
    text = text.replace("ங", "q");
    text = text.replace("சௌ", "nrs");
    text = text.replace("சோ", "Nrh");
    text = text.replace("சொ", "nrh");
    text = text.replace("சா", "rh");
    text = text.replace("சி", "rp");
    text = text.replace("சீ", "rP");
    text = text.replace("சு", "R");
    text = text.replace("சூ", "R+");
    text = text.replace("செ", "nr");
    text = text.replace("சே", "Nr");
    text = text.replace("சை", "ir");
    text = text.replace("ச்", "r;");
    text = text.replace("ச", "r");
    text = text.replace("ஞௌ", "nQs");
    text = text.replace("ஞோ", "NQh");
    text = text.replace("ஞொ", "nQh");
    text = text.replace("ஞா", "Qh");
    text = text.replace("ஞி", "Qp");
    text = text.replace("ஞீ", "QP");
    text = text.replace("ஞு", "*");
    text = text.replace("ஞூ", "*");
    text = text.replace("ஞெ", "nQ");
    text = text.replace("ஞே", "NQ");
    text = text.replace("ஞை", "iQ");
    text = text.replace("ஞ்", "Q;");
    text = text.replace("ஞ", "Q");
    text = text.replace("டௌ", "nls");
    text = text.replace("டோ", "Nlh");
    text = text.replace("டொ", "nlh");
    text = text.replace("டா", "lh");
    text = text.replace("டி", "b");
    text = text.replace("டீ", "B");
    text = text.replace("டு", "L");
    text = text.replace("டூ", "^");
    text = text.replace("டெ", "nl");
    text = text.replace("டே", "Nl");
    text = text.replace("டை", "il");
    text = text.replace("ட்", "l;");
    text = text.replace("ட", "l");
    text = text.replace("ணௌ", "nzs");
    text = text.replace("ணோ", "Nzh");
    text = text.replace("ணொ", "nzh");
    text = text.replace("ணா", "zh");
    text = text.replace("ணி", "zp");
    text = text.replace("ணீ", "zP");
    text = text.replace("ணு", "Z");
    text = text.replace("ணூ", "Z}");
    text = text.replace("ணெ", "nz");
    text = text.replace("ணே", "Nz");
    text = text.replace("ணை", "iz");
    text = text.replace("ண்", "z;");
    text = text.replace("ண", "z");
    text = text.replace("தௌ", "njs");
    text = text.replace("தோ", "Njh");
    text = text.replace("தொ", "njh");
    text = text.replace("தா", "jh");
    text = text.replace("தி", "jp");
    text = text.replace("தீ", "jP");
    text = text.replace("து", "J");
    text = text.replace("தூ", "J}");
    text = text.replace("தெ", "nj");
    text = text.replace("தே", "Nj");
    text = text.replace("தை", "ij");
    text = text.replace("த்", "j;");
    text = text.replace("த", "j");
    text = text.replace("நௌ", "nes");
    text = text.replace("நோ", "Neh");
    text = text.replace("நொ", "neh");
    text = text.replace("நா", "eh");
    text = text.replace("நி", "ep");
    text = text.replace("நீ", "eP");
    text = text.replace("நு", "E");
    text = text.replace("நூ", "E}");
    text = text.replace("நெ", "ne");
    text = text.replace("நே", "Ne");
    text = text.replace("நை", "ie");
    text = text.replace("ந்", "e;");
    text = text.replace("ந", "e");
    text = text.replace("னௌ", "nds");
    text = text.replace("னோ", "Ndh");
    text = text.replace("னொ", "ndh");
    text = text.replace("னா", "dh");
    text = text.replace("னி", "dp");
    text = text.replace("னீ", "dP");
    text = text.replace("னு", "D");
    text = text.replace("னூ", "D}");
    text = text.replace("னெ", "nd");
    text = text.replace("னே", "Nd");
    text = text.replace("னை", "id");
    text = text.replace("ன்", "d;");
    text = text.replace("ன", "d");
    text = text.replace("பௌ", "ngs");
    text = text.replace("போ", "Ngh");
    text = text.replace("பொ", "ngh");
    text = text.replace("பா", "gh");
    text = text.replace("பி", "gp");
    text = text.replace("பீ", "gP");
    text = text.replace("பு", "G");
    text = text.replace("பூ", "G+");
    text = text.replace("பெ", "ng");
    text = text.replace("பே", "Ng");
    text = text.replace("பை", "ig");
    text = text.replace("ப்", "g;");
    text = text.replace("ப", "g");
    text = text.replace("மௌ", "nks");
    text = text.replace("மோ", "Nkh");
    text = text.replace("மொ", "nkh");
    text = text.replace("மா", "kh");
    text = text.replace("மி", "kp");
    text = text.replace("மீ", "kP");
    text = text.replace("மு", "K");
    text = text.replace("மூ", "%");
    text = text.replace("மெ", "nk");
    text = text.replace("மே", "Nk");
    text = text.replace("மை", "ik");
    text = text.replace("ம்", "k;");
    text = text.replace("ம", "k");
    text = text.replace("யௌ", "nas");
    text = text.replace("யோ", "Nah");
    text = text.replace("யொ", "nah");
    text = text.replace("யா", "ah");
    text = text.replace("யி", "ap");
    text = text.replace("யீ", "aP");
    text = text.replace("யு", "A");
    text = text.replace("யூ", "A+");
    text = text.replace("யெ", "na");
    text = text.replace("யே", "Na");
    text = text.replace("யை", "ia");
    text = text.replace("ய்", "a;");
    text = text.replace("ய", "a");
    text = text.replace("ரௌ", "nus");
    text = text.replace("ரோ", "Nuh");
    text = text.replace("ரொ", "nuh");
    text = text.replace("ரா", "uh");
    text = text.replace("ரி", "up");
    text = text.replace("ரீ", "uP");
    text = text.replace("ரு", "U");
    text = text.replace("ரூ", "&");
    text = text.replace("ரெ", "nu");
    text = text.replace("ரே", "Nu");
    text = text.replace("ரை", "iu");
    text = text.replace("ர்", "u;");
    text = text.replace("ர", "u");
    text = text.replace("லௌ", "nys");
    text = text.replace("லோ", "Nyh");
    text = text.replace("லொ", "nyh");
    text = text.replace("லா", "yh");
    text = text.replace("லி", "yp");
    text = text.replace("லீ", "yP");
    text = text.replace("லு", "Y");
    text = text.replace("லூ", "Y}");
    text = text.replace("லெ", "ny");
    text = text.replace("லே", "Ny");
    text = text.replace("லை", "iy");
    text = text.replace("ல்", "y;");
    text = text.replace("ல", "y");
    text = text.replace("ளௌ", "nss");
    text = text.replace("ளோ", "Nsh");
    text = text.replace("ளொ", "nsh");
    text = text.replace("ளா", "sh");
    text = text.replace("ளி", "sp");
    text = text.replace("ளீ", "sP");
    text = text.replace("ளு", "S");
    text = text.replace("ளூ", "Sh");
    text = text.replace("ளெ", "ns");
    text = text.replace("ளே", "Ns");
    text = text.replace("ளை", "is");
    text = text.replace("ள்", "s;");
    text = text.replace("ள", "s");
    text = text.replace("வௌ", "nts");
    text = text.replace("வோ", "Nth");
    text = text.replace("வொ", "nth");
    text = text.replace("வா", "th");
    text = text.replace("வி", "tp");
    text = text.replace("வீ", "tP");
    text = text.replace("வு", "T");
    text = text.replace("வூ", "T+");
    text = text.replace("வெ", "nt");
    text = text.replace("வே", "Nt");
    text = text.replace("வை", "it");
    text = text.replace("வ்", "t;");
    text = text.replace("வ", "t");
    text = text.replace("ழௌ", "nos");
    text = text.replace("ழோ", "Noh");
    text = text.replace("ழொ", "noh");
    text = text.replace("ழா", "oh");
    text = text.replace("ழி", "op");
    text = text.replace("ழீ", "oP");
    text = text.replace("ழு", "O");
    text = text.replace("ழூ", "*");
    text = text.replace("ழெ", "no");
    text = text.replace("ழே", "No");
    text = text.replace("ழை", "io");
    text = text.replace("ழ்", "o;");
    text = text.replace("ழ", "o");
    text = text.replace("றௌ", "nws");
    text = text.replace("றோ", "Nwh");
    text = text.replace("றொ", "nwh");
    text = text.replace("றா", "wh");
    text = text.replace("றி", "wp");
    text = text.replace("றீ", "wP");
    text = text.replace("று", "W");
    text = text.replace("றூ", "W}");
    text = text.replace("றெ", "nw");
    text = text.replace("றே", "Nw");
    text = text.replace("றை", "iw");
    text = text.replace("ற்", "w;");
    text = text.replace("ற", "w");
    text = text.replace("ஹௌ", "n`s");
    text = text.replace("ஹோ", "N`h");
    text = text.replace("ஹொ", "n`h");
    text = text.replace("ஹா", "`h");
    text = text.replace("ஹி", "`p");
    text = text.replace("ஹீ", "`P");
    text = text.replace("ஹு", "{`");
    text = text.replace("ஹூ", "`_");
    text = text.replace("ஹெ", "n`");
    text = text.replace("ஹே", "N`");
    text = text.replace("ஹை", "i`");
    text = text.replace("ஹ்", "`;");
    text = text.replace("ஹ", "`");
    text = text.replace("ஷௌ", "n\\s");
    text = text.replace("ஷோ", "N\\h");
    text = text.replace("ஷொ", "n\\h");
    text = text.replace("ஷா", "\\h");
    text = text.replace("ஷி", "\\p");
    text = text.replace("ஷீ", "\\P");
    text = text.replace("ஷு", "\\{");
    text = text.replace("ஷூ", "\\_");
    text = text.replace("ஷெ", "n\\");
    text = text.replace("ஷே", "N\\");
    text = text.replace("ஷை", "i\\");
    text = text.replace("ஷ்", "\\;");
    text = text.replace('ஷ', '\\');
    text = text.replace("ஸௌ", "n]s");
    text = text.replace("ஸோ", "N]h");
    text = text.replace("ஸொ", "n]h");
    text = text.replace("ஸா", "]h");
    text = text.replace("ஸி", "]p");
    text = text.replace("ஸீ", "]P");
    text = text.replace("ஸு", "]{");
    text = text.replace("ஸூ", "]_");
    text = text.replace("ஸெ", "n]");
    text = text.replace("ஸே", "N]");
    text = text.replace("ஸை", "i]");
    text = text.replace("ஸ்", "];");
    text = text.replace("ஸ", "]");
    text = text.replace("அ", "m");
    text = text.replace("ஆ", "M");
    text = text.replace("இ", "๳");
    text = text.replace("ஈ", "<");
    text = text.replace("உ", "c");
    text = text.replace("ஊ", "C");
    text = text.replace("எ", "v");
    text = text.replace("ஏ", "V");
    text = text.replace("ஐ", "I");
    text = text.replace("ஒ", "x");
    text = text.replace("ஓ", "X");
    text = text.replace("ஔ", "xs");

    return text = text.replace("ஃ", "/");
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 Android 中呈现泰米尔语 unicode 的相关文章

  • 使用JACK时生成的proguard mappings.txt文件在哪里?

    我一直在尝试使用最新的JACK 和 JILL 构建系统到我的android项目 我知道JACK进程包括proguard处理 但之后我找不到映射 txt归档回溯堆栈跟踪Google Play 开发者控制台上提供的错误数 请帮我查找映射 txt
  • 64位版本的adb和fastboot?

    我在 Debian 7 3 x64 已完全修补 上发现了以下错误 我很确定这是因为adb即使在其 SDK 工具的 64 位发行版中也是 32 位 which adb opt android sdk platform tools adb op
  • 如何获取firebase数据库中所有孩子的数据?

    我有这个 firebase 数据库 我需要获取用户的所有电话号码 我应该使用哪个侦听器来获取所有孩子 每个用户都作为一个对象添加 其中用户 ID 作为该对象的名称 我需要在不知道用户 ID 的情况下检索该对象 我搜索了文档 它与DataSn
  • Material Design 与 Android 5.0 以下版本的兼容性?

    Android 5 0以下版本可以使用Material Design主题吗 根据这个链接 https developer android com design material index html 情况并非如此 材料设计是视觉 动作和设计
  • 如何在android.mk文件中指定c头文件

    我有一个 c 源文件夹名称 clib 其中 我有一些示例文件 例如 1 h 1 c 2 h 2 c 3 c 3 h 在该文件夹之外我有 4 个 h 4 c 4 jni h 4 jni c 现在为了构建 so 我创建了像这样的 android
  • 使用actionBar推送视图的正确方法[关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我是一名新的 Android 开发人员 所以我更喜欢询问正确的方法来解决我的问题 我有一个 FragmentActivity 和多个片段
  • 使用 IntentService 使用 Camera2 拍照

    我正在尝试创建一个可以拍照但不显示预览的应用程序 使用本教程 https www youtube com watch v oPu42I0HSi4 https www youtube com watch v oPu42I0HSi4如果我使用和
  • Android EditText 和 SearchView:主要区别是什么(设计除外)?

    我需要在我的 Android 应用程序中实现一个搜索界面 该界面可以过滤多个RecyclerView里面一个ViewPager 我已经实现了EditText and SearchView小部件并尝试查看差异 我感兴趣的听众是 myEditT
  • 在一天中的特定时间设置闹钟

    我正在尝试将闹钟设置在一天中的特定时间 例如 20 15 这是我正在使用的代码 但它不会在 20 15 关闭 Intent intent new Intent AlarmActivity this MyBroadcastReceiver c
  • 在Android上使用XStream时如何注释order字段?

    我需要从 Android 上的 java 对象生成 XML XML 节点必须位于 确定的顺序 这是我得到的 这些字段按字母顺序排列
  • NoClassDefFoundError:解析失败:Lio/realm/internal/LinkView

    我正在使用领域 我安装了 Stetho Realm 来查看领域数据 这就是我所做的 buildscript repositories google jcenter dependencies classpath com android too
  • Ctrl 单击 Eclipse 中的类显示二进制/jar 而不是源

    使用Eclipse 版本 Helios 服务版本 2 内部版本号 20110218 0911 与Android插件 我有一个 Android 项目 AndroidUtil 它被标记为我的主要 Android 应用程序的 库 项目 当我按住
  • Android Studio安装JDK错误

    In Android Studio I am facing bellow error 当我按下时会显示此弹出窗口Alt Enter对于缺少的类 符号 当我点击 setup SDK 时 它显示两个选项 1 8 Java版本 1 8 0 60
  • 清单合并失败:需要为 显式指定 android:exported

    我的清单文件有问题 错误消息 清单合并失败 android 需要为 明确指定导出 面向 Android 12 及更高版本的应用需要指定显式值android exported当相应的组件定义了意图过滤器时 有关详细信息 请参阅 https d
  • RecyclerView 来自 Firebase 的部分和数据

    您好 我正在开发一个应用程序 在其中我必须使用 Firebase 填充数据回收器视图 准备就绪 现在我想做的是用 data firebase 填写一个 recyclerview 但有一些部分将成为托管 data firebase 的父级 我
  • Android BottomNavigationView 与自定义视图作为图标[关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我正在尝试 Android 支持库中的新 BottomNavigationView 对于其中一个菜单项 我希望有一个自定义视图 以便我
  • 如何为Android设置图像顶部和底部相同的大小?

    我想在中心 顶部和底部显示相同尺寸的图像 请参阅下面的屏幕 有人知道请给我代码 谢谢大家 Use android scaleType centerInside or ImageView setScaleType ImageView Scal
  • Android 通知上有按钮

    我正在尝试使用 2 个按钮发出通知 一个带我回到活动 另一个将其关闭 有谁知道如何捕获按钮单击事件 请记住活动已暂停 我很高兴发布它 经过一夜的工作 我发现了一些东西 那么 我们开始吧 1 为您的通知创建 xml 布局文件 2 使用Noti
  • 在 IntelliJ IDEA 11 中编译期间未检测到模块依赖性

    我正在开发一个 Android 应用程序 我正在尝试包含图形视图 https github com jjoe64 GraphView绘制一些图表 需要将其作为模块依赖项包含在内 执行此操作后 IntelliJ IDE 会正确检测到包 我可以
  • StableArrayAdapter 与 ArrayAdapter

    我正在看这个ListView教程 列表视图教程 http www vogella com tutorials AndroidListView article html 我想知道创建自己的更好ArrayAdapter 而不仅仅是使用和Arra

随机推荐