土耳其字符的小写字母点缀我

编程入门 行业动态 更新时间:2024-10-27 08:32:38
本文介绍了土耳其字符的小写字母点缀我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在Java 6中,

System.out.println(String.valueOf('\u0130').toLowerCase());

打印i(u0069),但是在Java 7中,它用双点(u0069 u0307)打印i.

prints i (u0069), but in Java 7 it prints i with double dots (u0069 u0307).

我知道这是土耳其语字符,但是如何使用此代码使Java 7输出与v6相同的输出?

I understand it is a Turkish character, but how do I make Java 7 print the same output as v6 using this code?

System.out.println(inputText.toLowerCase());

还要确保代码可以处理国际文本,而无需对toLowerCase函数进行硬编码以仅使用土耳其语区域设置.

Also make sure that the code can handle international text without hardcoding the toLowerCase function to use only Turkish locale.

推荐答案

有一个非常详细的有关此i toLowerCase问题的博客文章

让我尝试总结以下重要部分:

Let me try to summarize the essential parts:

在Java 7中,此方法的确发生了变化,并且处理此字符的方式与Java 6不同.添加了以下代码:

In Java 7 this method has indeed changed and handles this char differently than Java 6. The following code was added:

} else if (srcChar == '\u0130') { // LATIN CAPITAL LETTER I DOT lowerChar = Character.ERROR; }

==>此更改以以下方式导致:

==> This change results in the following way:

基本上,此更改的最终结果是针对此特定情况 (大写的虚线I),Java 7现在使用特殊的Unicode 角色数据库 ( www.unicode/Public/UNIDATA/SpecialCasing.txt), 提供有关复杂案例映射的数据.查看此文件,您可以 看到几行大写的虚线I:

Basically the end result of this change is that for this specific case (the upper-case dotted I), Java 7 now consults a special Unicode character database (www.unicode/Public/UNIDATA/SpecialCasing.txt), which provides data on complex case-mappings. Looking at this file you can see several lines for the upper-case dotted I:

CODE LOWER TITLE UPPER LANGUAGE 0130; 0069 0307; 0130; 0130; 0130; 0069; 0130; 0130; tr; 0130; 0069; 0130; 0130; az;

更多推荐

土耳其字符的小写字母点缀我

本文发布于:2023-10-16 17:03:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498190.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:土耳其   点缀   字母   字符

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!