Go to file
Charles Iliya Krempeaux e35f8ab59d "utf8s" -> "utf8" 2022-07-18 16:30:32 -07:00
LICENSE initial commit 2018-07-01 23:04:04 -07:00
README.md "utf8s" -> "utf8" 2022-07-18 16:30:32 -07:00
doc.go utf8s.RuneScanner docs 2018-07-10 21:01:30 -07:00
errors.go utf8s.RuneReader 2018-07-10 20:56:30 -07:00
format.go utf8s.FormatBinary() 2018-07-01 23:27:20 -07:00
format_test.go utf8s.FormatBinary() 2018-07-01 23:27:20 -07:00
invalidutf8.go utf8s.InvalidUTF8Complainer 2018-07-02 02:16:14 -07:00
len.go added more docs 2018-07-02 11:28:12 -07:00
len_test.go utf8s.Len() 2018-07-02 11:14:48 -07:00
nilreader.go utf8s.NilReaderComplainer 2018-07-02 02:15:35 -07:00
nilwriter.go added another error check. 2018-07-02 11:26:04 -07:00
readrune.go improved docs 2018-07-02 01:36:39 -07:00
readrune_test.go added some more tests 2020-08-05 21:31:31 -07:00
runeerror.go "utf8s" -> "utf8" 2022-07-18 16:30:32 -07:00
runereader.go utf8s.RuneReader 2018-07-10 20:56:30 -07:00
runereader_test.go utf8s.RuneReader 2018-07-10 20:40:40 -07:00
runescanner.go utf8s.RuneError 2019-09-10 08:27:52 -07:00
runescanner_test.go utf8s.RuneScanner 2018-07-10 21:33:46 -07:00
runewriter.go utf8s.RuneWriter 2019-09-11 12:36:02 -07:00
runewriter_test.go "utf8s" -> "utf8" 2022-07-18 16:30:32 -07:00
writerune.go added another error check. 2018-07-02 11:26:04 -07:00
writerune_test.go utf8s.WriteRune() 2018-07-02 02:37:29 -07:00

README.md

go-utf8

Package utf8s 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 := utf8s.ReadRune(reader)
var writer io.Writer

// ...

var r rune

// ...

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

// ...

runeReader := utf8s.NewRuneReader(reader)

// ...

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

// ...

runeScanner := utf8s.NewRuneScanner(reader)

// ...

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

// ...

err = runeScanner.UnreadRune()