Go to file
Charles Iliya Krempeaux 3cd00adfc5 Len() -> RuneLength() 2022-07-18 18:50:29 -07:00
LICENSE initial commit 2018-07-01 23:04:04 -07:00
README.md "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
doc.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
errors.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
format.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
format_test.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
invalidutf8.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
nilreader.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
nilwriter.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
readrune.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
readrune_test.go Len() -> RuneLength() 2022-07-18 18:50:29 -07:00
runeerror.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
runelength.go Len() -> RuneLength() 2022-07-18 18:46:19 -07:00
runelength_test.go Len() -> RuneLength() 2022-07-18 18:48:37 -07:00
runereader.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
runereader_test.go Len() -> RuneLength() 2022-07-18 18:50:29 -07:00
runescanner.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
runescanner_test.go Len() -> RuneLength() 2022-07-18 18:50:29 -07:00
runewriter.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
runewriter_test.go Len() -> RuneLength() 2022-07-18 18:50:29 -07:00
writerune.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00
writerune_test.go "utf8s" -> "utf8" 2022-07-18 16:36:02 -07:00

README.md

go-utf8

Package utf8 provides tools for working with Unicode encoded as UTF-8, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-utf8

GoDoc

Example

var reader io.Reader

// ...

r, n, err := utf8.ReadRune(reader)
var writer io.Writer

// ...

var r rune

// ...

n, err := utf8.WriteRune(w, r)
var reader io.Reader

// ...

runeReader := utf8.NewRuneReader(reader)

// ...

r, n, err := runeReader.ReadRune()
var reader io.Reader

// ...

runeScanner := utf8.NewRuneScanner(reader)

// ...

r, n, err := runeScanner.ReadRune()

// ...

err = runeScanner.UnreadRune()