We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Used code: package main import ( "code.google.com/p/go-charset/charset/iconv" "encoding/hex" "log" "fmt" ) func main() { input := "é" t, err := iconv.Translator("ASCII//TRANSLIT", "UTF-8", 'x') if err != nil { log.Fatalf("Coult not get charset translator from UTF-8 to ASCII. Got error: %s\n", err) return } fmt.Print(hex.Dump([]byte(input))) n, cdata, err := t.Translate([]byte(input), true) if err != nil { log.Fatalf("Could not translate string '%s' to ASCII. Got error: %s\n", input, err) } fmt.Print(hex.Dump(cdata)) output := string(cdata) log.Printf("Translated %d characters from UTF-8 ('%s') to ASCII ('%s')\n", n, input, output) } Go version: go version go1.0.1 Error: geertjohan@VirtKubuntu:~$ iconvtesting 00000000 c3 a9 |..| panic: runtime error: slice bounds out of range goroutine 1 [running]: code.google.com/p/go-charset/charset/iconv.(*iconvTranslator).Translate(0xf84003 e400, 0xf840045112, 0x0, 0x200000001, 0x0, ...) /tmp/go-build714705259/code.google.com/p/go-charset/charset/iconv/_obj/iconv.cgo1.go:157 +0x4ea main.main() /home/geertjohan/Workspaces/WorkspaceGo/devpath/src/iconvtesting/iconvtesting.go:20 +0x24c goroutine 2 [syscall]: created by runtime.main /home/geertjohan/Applications/go/src/pkg/runtime/proc.c:221
Original issue reported on code.google.com by [email protected] on 20 Jun 2012 at 7:40
[email protected]
The text was updated successfully, but these errors were encountered:
Sorry I should have noted in the title that this concerns iconv translation.
Original comment by [email protected] on 20 Jun 2012 at 7:54
Sorry, something went wrong.
Original comment by [email protected] on 20 Jun 2012 at 9:16
No branches or pull requests
Original issue reported on code.google.com by
[email protected]
on 20 Jun 2012 at 7:40The text was updated successfully, but these errors were encountered: