更新时间:2023-02-26 12:31:09
我已经写阿拉伯文文本一个TextView很多次,没有看到一个堆栈溢出异常,这也是一个从右到左(RTL)语言。你修改的onDraw()
方法或任何其他方法可能会造成这个错误?
I have written Arabic text to a TextView many times without seeing a stack overflow exception, which is also a Right-to-Left (RTL) language. Did you modify the onDraw()
method or any other method that might be causing this error?
如果您无法找到原因,这应该返回真正
如果给定的的inputText
包含希伯来字符:
If you can't find the reason, this should return true
if the given inputText
contains Hebrew characters:
Pattern.matches("(\\p{InHebrew})+", inputText);
您可能还希望如果其他语言可能会带来问题,以禁止任何非拉丁字符。本网站包含了所有你能匹配的UNI code脚本的列表:
结果正则表达式教程 - 统一code字符
You might also want to disallow any non-Latin characters if other languages cause problems as well. This site contains a list of all of the unicode scripts you can match against:
Regex Tutorial - Unicode Characters