优化文本编码识别
This commit is contained in:
parent
30674fceb1
commit
ab86cb2789
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user