Module kana provides transformation between:
- Fullwidth and halfwidth characters
- Katakana and hiragana
It also provides NKF-compatible wrapper.
package main
import (
"fmt"
"github.com/wantedly/kana-go"
)
func main() {
str := kana.Convert("ABC DEF", kana.FullwidthToNarrow)
fmt.Println(str) // Output: ABC DEF
}
package main
import (
"fmt"
"github.com/wantedly/kana-go/nkf"
)
func main() {
str, err := nkf.Convert("ABC DEF", "-w -W -m0 -Z1")
if err != nil {
panic(err)
}
fmt.Println(str) // Output: ABC DEF
}