internal/export/idna: add generator for IDNA tables

The code is now internal to x/text. The generation code will probably
stay there for now. The generated code can end up in x/net/idna.

Note that this package has its own tables that do not rely on
unicode/norm, width, cases, etc. UTS golang/go#46 (and IDNA2008 to some
extent) define slight variations for all of these and dealing with
that gets very tedious and error prone. Advantages:
- much less error prone
- avoid security issues from having mixed Unicode versions
- it is a considerably faster
- it is more compact than if all the other tables are pulled in
- spec-conform invalid UTF-8 handling supported by trie, but not
  by core unicode/utf8

Updates golang/go#17268

Change-Id: I6b4cfbcfd4386c5e005cef23365e5dd327eb972c
Reviewed-on: https://go-review.googlesource.com/30392
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 files changed