github.com/go-xe2/third@v1.0.3/golang.org/x/text/encoding/ianaindex/example_test.go (about)

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package ianaindex_test
     6  
     7  import (
     8  	"fmt"
     9  
    10  	"github.com/go-xe2/third/golang.org/x/text/encoding/charmap"
    11  	"github.com/go-xe2/third/golang.org/x/text/encoding/ianaindex"
    12  )
    13  
    14  func ExampleIndex() {
    15  	fmt.Println(ianaindex.MIME.Name(charmap.ISO8859_7))
    16  	fmt.Println(ianaindex.IANA.Name(charmap.ISO8859_7))
    17  	fmt.Println(ianaindex.MIB.Name(charmap.ISO8859_7))
    18  
    19  	e, _ := ianaindex.IANA.Encoding("cp437")
    20  	fmt.Println(ianaindex.IANA.Name(e))
    21  
    22  	// Output:
    23  	// ISO-8859-7 <nil>
    24  	// ISO_8859-7:1987 <nil>
    25  	// ISOLatinGreek <nil>
    26  	// IBM437 <nil>
    27  }