Skip to content

Commit

Permalink
all: support multiple versions of Unicode
Browse files Browse the repository at this point in the history
Different Go compilers support different versions of Unicode.
In general, one should match the version of x/text to match
the Unicode version of the Go core. This is quite painful and
restrictive in practice.

x/text now supports multiple versions of Unicode concurrently
which are selected based on the Go compiler used (from 1.7).

Change-Id: I9a999bf603872a88932740ca7eb518c247519e06
Reviewed-on: https://go-review.googlesource.com/83235
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
  • Loading branch information
mpvl committed Dec 13, 2017
1 parent 3b24cac commit c4d099d
Show file tree
Hide file tree
Showing 47 changed files with 45,949 additions and 1,079 deletions.
14 changes: 8 additions & 6 deletions README.md
Expand Up @@ -9,16 +9,18 @@ This repo uses Semantic versioning (http://semver.org/), so
and
1. PATCH version when you make backwards-compatible bug fixes.

A Unicode major and minor version bump is mapped to a major version bump in
x/text.
A path version bump in Unicode is mapped to a minor version bump in x/text.
Note that, consistent with the definitions in semver, until version 1.0.0 of
x/text is reached, the minor version is considered a major version.
So going from 0.1.0 to 0.2.0 is considered to be a major version bump.
Until version 1.0.0 of x/text is reached, the minor version is considered a
major version. So going from 0.1.0 to 0.2.0 is considered to be a major version
bump.

A major new CLDR version is mapped to a minor version increase in x/text.
Any other new CLDR version is mapped to a patch version increase in x/text.

It is important that the Unicode version used in `x/text` matches the one used
by your Go compiler. The `x/text` repository supports multiple versions of
Unicode and will match the version of Unicode to that of the Go compiler. At the
moment this is supported for Go compilers from version 1.7.

## Download/Install

The easiest way to install is to run `go get -u golang.org/x/text`. You can
Expand Down
4 changes: 2 additions & 2 deletions cases/gen.go
Expand Up @@ -207,7 +207,7 @@ func genTables() {
}

w := gen.NewCodeWriter()
defer w.WriteGoFile("tables.go", "cases")
defer w.WriteVersionedGoFile("tables.go", "cases")

gen.WriteUnicodeVersion(w)

Expand Down Expand Up @@ -761,7 +761,7 @@ func genTablesTest() {

fmt.Fprintln(w, ")")

gen.WriteGoFile("tables_test.go", "cases", w.Bytes())
gen.WriteVersionedGoFile("tables_test.go", "cases", w.Bytes())
}

// These functions are just used for verification that their definition have not
Expand Down
2 changes: 2 additions & 0 deletions cases/tables.go → cases/tables10.0.0.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cases/tables_test.go → cases/tables10.0.0_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,213 changes: 2,213 additions & 0 deletions cases/tables9.0.0.go

Large diffs are not rendered by default.

0 comments on commit c4d099d

Please sign in to comment.