liveBook · Manning

UTF-8

As explained in Go in Practice, Second Edition

UTF-8 is a variable-width Unicode character encoding that represents Unicode text as sequences of bytes.

UTF-8 is a variable-width Unicode character encoding that represents Unicode text as byte sequences. Go handles data internally as UTF-8, but systems may exchange Base64, JSON, XML, or other encodings, requiring translation at system boundaries. section 1.2.2

Practical implications for Go data handling:

  • Treat UTF-8 as Go's native text representation. section 1.2.2
  • Use standard-library packages and interfaces to convert encoded data into local objects or structs. section 1.2.2
  • Add external encoding packages when the required translation is not provided directly. section 1.2.2

How Go in Practice, Second Edition covers it

How deep it goes
Places UTF-8 in Go's data-encoding workflow but stops short of byte-level mechanics or conversion code.
Examples
Uses networked data exchange, JSON/XML conversion, and alternate-encoding translation as examples.
What you can do after
Apply UTF-8 awareness when exchanging data and select Go packages or interfaces for translation.
How it connects
Connects Unicode text encoding with JSON, XML, Base64, interfaces, and external encoding packages.

Also explained in

Compare how 11 books explain UTF-8 →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Go in Practice, Second Edition. The section links point to the parts of the book it draws on.