You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
645 B

  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. package ianaindex_test
  5. import (
  6. "fmt"
  7. "golang.org/x/text/encoding/charmap"
  8. "golang.org/x/text/encoding/ianaindex"
  9. )
  10. func ExampleIndex() {
  11. fmt.Println(ianaindex.MIME.Name(charmap.ISO8859_7))
  12. fmt.Println(ianaindex.IANA.Name(charmap.ISO8859_7))
  13. fmt.Println(ianaindex.MIB.Name(charmap.ISO8859_7))
  14. e, _ := ianaindex.IANA.Encoding("cp437")
  15. fmt.Println(ianaindex.IANA.Name(e))
  16. // Output:
  17. // ISO-8859-7 <nil>
  18. // ISO_8859-7:1987 <nil>
  19. // ISOLatinGreek <nil>
  20. // IBM437 <nil>
  21. }