1. About file encoding general file saving (text file) It is also the reason for the current system default language (character set) encoding, so some Chinese characters will show garbled in Japanese system. It is said that it is to open the file. Different platforms are different, such as Chinese characters. Sets include A, B, C, Japanese character sets including A, B. When decoding Chinese characters C, there will be so-called garbled when the Chinese character C is decoded.
2. Java Work Processing Coding Mode (1) Java will store characters in Unicode in the running period, which is advantageous to support multi-language environments. (2) Java is default the default language according to the system when reading the file (character set) Coding to decode file, read, and save the encoding inconsistencies in the program, also lead to the parameter value in the program, read files with the FileInputStream class, can specify the encoding reading (3) Java When output to the system interface (Windows) The character is encoded by the system default language (character set), so it will also encounter a series of encoding problems during the output. Solution (1) Swing / AWT: Output to the system interface decoding can be displayed by setting the component display Font to replace system character set decoding, for example: public static void setfont (font pfont) {UIManager.put ("Button.Font", PFont); UIManager.Put ("ToggleButton.Font", PFont; UIManager.put ("Radiobutton .font ", pfont); UIManager.put (" Checkbox.Font ", PFont); UIManager.Put (" colorchooser.font ", pfont); UIManager.put (" ToggleButton.Font ", PFont); UIManager.put "ComboBox.font", PFont; UIManager.Put ("ComboBoxItem.font", PFont; UIManager.Put ("INTERNALFRAME.TILEFONT", PFONT); UIManager.put ("label.font", pfont); UIManager. PUT ("List.Font", PFont; UIManager.Put ("MenuBar.font", PFont); UIManager.put ("Menu.Font", PFont); UIManager.Put ("MenuItem.Font", PFont; UIManager.put ("RadiobuttonMenuItem.font", PFont); UIManager.put ("CheckBoxMenuItem.font", PFont); UIMAN Ager.put ("Popupmenu.Font", PFont; UIManager.Put ("optionpane.font", pfont; uimanager.put ("Panel.Font", PFont); UIManager.put ("progressbar.font", PFont UIManager.Put ("scrollpane.font", pfont; uimanager.put ("viewport", pfont); uimanager.put ("tabbedpane.font", pfont; uimanager.put ("TableHeader.Font", PFont ); UIManager.Put ("Table.Font", PFont); UIManager.put ("textfield.font", pfont); uimanager.put ("