зеркало из https://github.com/softlandia/cpd.git
README.md
This commit is contained in:
Родитель
d8dd1a8ae5
Коммит
66d8674292
|
@ -43,8 +43,8 @@
|
|||
IDCodePage uint16 - индекс кодовой страницы, значения взяты из файла поставки golang golang.org\x\text\encoding\internal\identifier\mib.go
|
||||
поддерживается interface String(), и можно выводить так
|
||||
cp := cpd.UTF8
|
||||
fmt.Printf("code page index, name: %d, %s\n", cp, cp)
|
||||
>>code page index, name: 106, UTF-8
|
||||
fmt.Printf("code page index: %d, name: %s\n", cp, cp)
|
||||
>> code page index: 106, name: UTF-8
|
||||
|
||||
## глобальные переменные ##
|
||||
|
||||
|
|
10
README.md
10
README.md
|
@ -38,7 +38,12 @@ have touble with detecting UTF32 without russians char
|
|||
|
||||
## types ##
|
||||
|
||||
IDCodePage uint16 - index of code page, support String() interface, you can fmt.Printf("code page index, name: %d, %s\n", cp, cp) where var cp received from cpd functions
|
||||
IDCodePage uint16 - index of code page, support String() interface
|
||||
```
|
||||
cp := cpd.UTF8
|
||||
fmt.Printf("code page index: %d, name: %s\n", cp, cp)
|
||||
>> code page index: 106, name: UTF-8
|
||||
```
|
||||
|
||||
## variables ##
|
||||
|
||||
|
@ -64,7 +69,6 @@ ReadBufSize int = 1024 // default count of byte to read from input reader for de
|
|||
detect code page of ascii data from reader 'r'
|
||||
use library 'reflect' to check input reader
|
||||
default read only first 1024 byte from 'r' (var ReadBufSize to change this setting)
|
||||
input parameter stopStr not using
|
||||
|
||||
FileCodepageDetect(fn string, stopStr ...string) (IDCodePage, error)
|
||||
detect code page of text file "fn", read first 1024 byte (var ReadBufSize to change this setting)
|
||||
|
@ -72,7 +76,7 @@ ReadBufSize int = 1024 // default count of byte to read from input reader for de
|
|||
return cpd.ASCII if code page not detected
|
||||
return one of next constant (code_pages_id.go): cpd.IBM866, cpd.Windows1251, cpd.KOI8R, cpd.UTF8, UTF16LE, UTF16BE
|
||||
file must contain characters of the Rusian alphabet
|
||||
string stopStr now not using
|
||||
input parameter `stopStr` not using
|
||||
|
||||
func StrConvertCodePage(s string, fromCP, toCP IDCodePage) (string, error)
|
||||
convert string from one code page to another, support Windows1251 & IBM866
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package cpd
|
||||
package cpd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
30
linter.md
30
linter.md
|
@ -1,30 +0,0 @@
|
|||
utf8.go:113:6: `toUTF8` is unused (deadcode)
|
||||
func toUTF8(s string) string {
|
||||
^
|
||||
cpd_test.go:235:6: `tDecodeUTF16be` is unused (deadcode)
|
||||
type tDecodeUTF16be struct {
|
||||
^
|
||||
code_pages.go:60:9: Error return value of `r.Read` is not checked (errcheck)
|
||||
r.Read(make([]byte, UTF8.BomLen())) // считываем в никуда количество байт занимаемых BOM этой кодировки
|
||||
^
|
||||
cpd.go:183:17: Error return value of `tmpReader.Read` is not checked (errcheck)
|
||||
tmpReader.Read(make([]byte, cp.BomLen())) // считываем в никуда количество байт занимаемых BOM этой кодировки
|
||||
^
|
||||
cpd_test.go:184:9: Error return value of `os.Link` is not checked (errcheck)
|
||||
os.Link(fp.Join("test_files/866to1251.txt"), fp.Join("test_files/866to1251.tmp"))
|
||||
^
|
||||
sample\detect-all-files\main.go:18:14: Error return value of `FindFilesExt` is not checked (errcheck)
|
||||
FindFilesExt(&fl, ".\\", os.Args[1])
|
||||
^
|
||||
cpd_test.go:236:2: `iStr` is unused (structcheck)
|
||||
iStr string
|
||||
^
|
||||
cpd_test.go:237:2: `oStr` is unused (structcheck)
|
||||
oStr string
|
||||
^
|
||||
cpd_test.go:72:2: `st` is unused (structcheck)
|
||||
st string //stop string, not using now
|
||||
^
|
||||
cpTable.go:33:19: func `(*cpTable).sort` is unused (unused)
|
||||
code_pages.go:210:24: func `TCodepagesDic.clear` is unused (unused)
|
||||
cpTable.go:27:19: func `(*cpTable).clear` is unused (unused)
|
Загрузка…
Ссылка в новой задаче