19 package org.sleuthkit.autopsy.coreutils;
21 import java.awt.ComponentOrientation;
38 for (
char c : text.toCharArray()) {
39 if (Character.isWhitespace(c)) {
44 byte direction = Character.getDirectionality(c);
45 if (direction == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
46 || direction == Character.DIRECTIONALITY_RIGHT_TO_LEFT) {
51 ComponentOrientation orientation = ComponentOrientation.LEFT_TO_RIGHT;
52 if (text.length() > 1024 && rtl_cnt > 50) {
53 orientation = ComponentOrientation.RIGHT_TO_LEFT;
54 }
else if (text.length() <= 1024 && rtl_cnt > text.length() / 4) {
55 orientation = ComponentOrientation.RIGHT_TO_LEFT;
84 return ((ch <= 0xFDD0 || ch >= 0xFDEF)
85 && (ch > 0x1F || ch == 0x9 || ch == 0xA || ch == 0xD)
86 && (ch % 0x10000 != 0xFFFF)
87 && (ch % 0x10000 != 0xFFFE));
static ComponentOrientation getTextDirection(String text)
static boolean isValidSolrUTF8(char ch)