Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
iconv binding for golang
branch: master

This branch is 20 commits ahead of oibore:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


import ""

Bindings for iconv. Iconv is a set of functions used to convert strings between different character sets


func Conv(input string, tocode string, fromcode string) (string, error)

Utility function which create a codec, convert the string and then destroy it


type Iconv struct {
    // contains filtered or unexported fields

Opaque structure containing the internal state of the codec

func Open(tocode string, fromcode string) (*Iconv, error)

Create a codec which convert a string encoded in fromcode into a string encoded in tocode

If you add //TRANSLIT at the end of tocode, any character which doesn't exists in the destination charset will be replaced by its closest equivalent (for example, € will be represented by EUR in ASCII). Else, such a character will trigger an error.

func (cd *Iconv) Close() error

Destroy the internal state of the codec, releasing associated memory

func (cd *Iconv) Conv(input string) (result string, err error)

Use the codec to convert a string

Something went wrong with that request. Please try again.