func OpenUnicodeFile(category, version, file string) io.ReadCloser {
	if version == "" {
		version = UnicodeVersion()
	}
	return openUnicode(path.Join(category, version, file))
}
OpenUnicodeFile opens the requested file of the requested category from the
root of the Unicode data archive. The file is specified relative to the
public Unicode root directory. If version is "", it will use the default
Unicode version. It will call log.Fatal if there are any errors.
package gen  
import (
	"bytes"
	"flag"
	"fmt"
	"go/build"
	"go/format"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"path"
	"path/filepath"
	"strings"
	"sync"
	"unicode"
	"golang.org/x/text/unicode/cldr"
)
var (
	url = flag.String("url",
		"http://www.unicode.org/Public",
		"URL of Unicode database directory")
	iana = flag.String("iana",
		"http://www.iana.org",
		"URL of the IANA repository")
	unicodeVersion = flag.String("unicode",
		getEnv("UNICODE_VERSION", unicode.Version),
		"unicode version to use")
	cldrVersion = flag.String("cldr",
		getEnv("CLDR_VERSION", cldr.Version),
		"cldr version to use")
)
func getEnv(name, def string) string {
	if v := os.Getenv(name); v != "" {
		return v
	}
	return def
}
func Init() {
	log.SetPrefix("")
	log.SetFlags(log.Lshortfile)
	flag.Parse()
}
const header = ` 
`
func UnicodeVersion() string {
	return *unicodeVersion
}
func CLDRVersion() string {
	return *cldrVersion
}
var tags = []struct{ version, buildTags string }{
	{"10.0.0", "go1.10"},
	{"", "!go1.10"},
}
func buildTags() string {
	v := UnicodeVersion()
	for _, x := range tags {
		if len(x.version) <= len(v) {
			return x.buildTags
		}
		if len(x.version) == len(v) && x.version <= v {
			return x.buildTags
		}
	}
	return tags[0].buildTags
}
func IsLocal() bool {
	dir, err := localReadmeFile()
	if err != nil {
		return false
	}
	if _, err = os.Stat(dir); err != nil {
		return false
	}
	return true
}
func OpenUCDFile(file string) io.ReadCloser {
	return openUnicode(path.Join(*unicodeVersion, "ucd", file))
}
func OpenCLDRCoreZip() io.ReadCloser {
	return OpenUnicodeFile("cldr", *cldrVersion, "core.zip")
}