We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ff330e commit 688053bCopy full SHA for 688053b
googletts/option.go
@@ -3,6 +3,7 @@ package googletts
3
import (
4
"errors"
5
"strconv"
6
+ "unicode/utf8"
7
)
8
9
// Option contains optional parameters for Google TTS API.
@@ -53,7 +54,7 @@ func (o Option) getTextLength() string {
53
54
if o.TextLength > 0 {
55
return strconv.Itoa(o.TextLength)
56
}
- return strconv.Itoa(len(o.Text))
57
+ return strconv.Itoa(utf8.RuneCountInString(o.Text))
58
59
60
func (o Option) getToken() string {
0 commit comments