您可以使用golang.org/x/text/encoding/unicode包將您的字符串編碼為 UTF16。使用這個(gè)包你可以寫這樣的東西: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
- 1 回答
- 0 關(guān)注
- 142 瀏覽
添加回答
舉報(bào)
0/150
提交
取消