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;
80 return ((ch <= 0xFDD0 || ch >= 0xFDEF) && (ch > 0x1F || ch == 0x9 || ch == 0xA || ch == 0xD) && (ch != 0xFFFF) && (ch != 0xFFFE));
static ComponentOrientation getTextDirection(String text)
static boolean isValidSolrUTF8(char ch)