您可以使用golang.org/x/text/encoding/unicode包将您的字符串编码为 UTF16。
使用这个包你可以写这样的东西:
utf16 := unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM)
encoded, err := utf16.NewEncoder().String("encodedsecret")
modify := ldap.NewModifyRequest(dn)
modify.Replace("unicodePwd", []string{encoded})
// do something with modify
qq_笑_17
芜湖不芜
随时随地看视频慕课网APP
相关分类