Coded format detection method and coded format detection device for text files
The invention discloses a coded format detection method and a coded format detection device for text files, which belong to the field of file processing. The method includes the steps: dividing one text file into a plurality of text segments; if byte codes of first four bytes in a current text segme...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention discloses a coded format detection method and a coded format detection device for text files, which belong to the field of file processing. The method includes the steps: dividing one text file into a plurality of text segments; if byte codes of first four bytes in a current text segment is larger than 0x00 and smaller than 0x7F, determining a coded format of the current text segment as ASCII (American standard code for information interchange); otherwise, detecting in corresponding coded format groups according to the coded byte size adopted by the byte codes, and transforming the current text segment into the correspondingly matched coded format according to a detecting result; and reading bytes in a next text segment for detection until all the text files are transformed. By the aid of the method and the device, text codes unmatched with coded byte order identifiers are judged by grouping, various coded formats are transformed, and messy codes cannot be generated when the coded formats in dis |
---|