encoding

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBinary

func IsBinary(content []byte) bool

IsBinary: 콘텐츠가 바이너리인지 확인. 우선 Go 표준 라이브러리의 포맷 파서로 실행파일 형식을 감지하고, 이후 mimetype으로 이미지/아카이브 등 기타 바이너리를 판별.

  • debug/elf: Linux/BSD ELF 실행파일
  • debug/macho: macOS Mach-O 실행파일
  • debug/pe: Windows PE 실행파일
  • mimetype: 그 외 바이너리 (이미지, ZIP, PDF 등)

Types

type Result

type Result struct {
	Valid           bool
	HasBOM          bool
	DetectedCharset string
	Confidence      int
}

Result: 파일 인코딩 검사 결과.

func CheckUTF8

func CheckUTF8(content []byte) Result

CheckUTF8: 콘텐츠가 유효한 UTF-8인지 검증. 유효성은 바이트 시퀀스로 직접 판단하고, chardet은 에러 메시지용 charset 이름 제공에만 사용.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL