优化文本编码识别

This commit is contained in:
许轲 2023-08-10 14:09:45 +08:00
parent 30674fceb1
commit ab86cb2789

View File

@ -99,11 +99,8 @@ public class JNotepad extends Application {
tabPane.getTabs().add(tab);
tabPane.getSelectionModel().select(tab);
updateStatusLabel(textArea);
}
// 创建场景并设置主界面
Scene scene = new Scene(root, 800, 600);
primaryStage.setScene(scene);
@ -232,7 +229,7 @@ public class JNotepad extends Application {
int row = getRow(textArea.getCaretPosition(), textArea.getText());
int column = getColumn(textArea.getCaretPosition(), textArea.getText());
int length = textArea.getLength();
statusLabel.setText("行: " + row + " \t列: " + column + " \t字数: " + length+"\t编码: ");
statusLabel.setText("行: " + row + " \t列: " + column + " \t字数: " + length);
});
}
@ -283,7 +280,7 @@ public class JNotepad extends Application {
}
}
encodingLabel.setText(detectedEncoding);
encodingLabel.setText("\t编码: "+detectedEncoding);
}
private boolean isEncodingValid(String text, String encoding) {