iconv

package
v1.62.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package iconv provides utilities to convert characters into different charsets

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

func (*Converter) Convert

func (t *Converter) Convert(reader io.Reader) io.Reader

func (*Converter) ConvertBytes

func (t *Converter) ConvertBytes(input []byte) ([]byte, error)

func (*Converter) ConvertBytesWithContext added in v1.24.0

func (t *Converter) ConvertBytesWithContext(ctx context.Context, input []byte) ([]byte, error)

func (*Converter) ConvertString

func (t *Converter) ConvertString(input string) (string, error)

func (*Converter) ConvertStringWithContext added in v1.24.0

func (t *Converter) ConvertStringWithContext(ctx context.Context, input string) (transformedStr string, err error)

func (*Converter) String

func (t *Converter) String() string

type ICharsetConverter

type ICharsetConverter interface {
	// ConvertString converts the charset of an input string
	ConvertString(input string) (string, error)

	// ConvertStringWithContext converts the charset of an input string
	ConvertStringWithContext(ctx context.Context, input string) (string, error)

	// ConvertBytes converts the charset of an input byte array
	ConvertBytes(input []byte) ([]byte, error)

	// ConvertBytesWithContext converts the charset of an input byte array
	ConvertBytesWithContext(ctx context.Context, input []byte) ([]byte, error)

	// Convert converts the charset of a reader
	Convert(reader io.Reader) io.Reader

	// String describes the conversion
	String() string
}

func NewConverter

func NewConverter(fromEncoding encoding.Encoding, toEncoding encoding.Encoding) ICharsetConverter

Jump to

Keyboard shortcuts

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