In article
<97348a7c-4833-4004-ae03-a3aa370dffc8.RemoveThis@i8g2000pro.googlegroups.com>,
erikm <erik.myllymaki.RemoveThis@gmail.com> wrote:
> I'm new to obj-c and was hoping for a pointer in the right direction.
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Clas
ses/NSString_Class/Reference/NSString.html>
> I'm working with a calendaring project (SOGo) written in obj-c and it
> inter-operates with MS Active Directory.
>
> In order to change a password in AD, the new password has to be
> formatted in a specific way. An example of how this is done in Java is
> here:
>
> # // Replace the "unicdodePwd" attribute with a new
> value
> # // Password must be both Unicode and a quoted string
> # String newQuotedPassword = "\"" + newPassword + "\"";
> # byte[] newUnicodePassword = newQuotedPassword.getBytes
> ("UTF-16LE");
NSString * newQuotedPassword =
[NSString stringWithFormat: @"\"%@\"", password];
char const * bytes = [newQuotedPassword
cStringUsingEncoding: NSUTF16LittleEndianStringEncoding];
Reinder