Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encoding ¶
Encoding detects guesses of character encoding name from byte stream
Example ¶
package main
import (
"fmt"
"strings"
"github.com/goark/gnkf/guess"
)
func main() {
elist, err := guess.Encoding(strings.NewReader("こんにちは,世界!\n私の名前は Spiegel です。"))
if err != nil {
fmt.Println(err)
return
}
fmt.Println(strings.Join(elist, ","))
}
Output: UTF-8,windows-1252,windows-1253,Shift_JIS,windows-1255
func EncodingBytes ¶
EncodingBytes detects guesses of character encoding name from byte array
Example ¶
package main
import (
"fmt"
"strings"
"github.com/goark/gnkf/guess"
)
func main() {
elist, err := guess.EncodingBytes([]byte("こんにちは,世界!\n私の名前は Spiegel です。"))
if err != nil {
fmt.Println(err)
return
}
fmt.Println(strings.Join(elist, ","))
}
Output: UTF-8,windows-1252,windows-1253,Shift_JIS,windows-1255
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.