Hi,

Have you tried to make the namespace a binary value and pass the user and password as a parameter?

s Attr3=$lb(128,"intersystems-Namespace",$lb("%SYS"))
 s Attr4=$lb(0,"intersystems-Routine",$lb("iscRoutine"))
 s Attr5=$lb(0,"intersystems-Roles",$lb("iscRole1","iscRole2"))
 s Attr6=$lb(0,"userPassword",$lb(password))
 s Attr7=$lb(0,"cn",$lb("test20"))
 s Attr8=$lb(0,"uidNumber",$lb(58129))
 s Attr9=$lb(0,"gidNumber",$lb(58129))
 s Attr10=$lb(0,"homeDirectory",$lb("/home/test20"))
 s Attributes=$lb(Attr1,Attr2,Attr3,Attr4,Attr5,Attr6,Attr7,Attr8,Attr9,Attr10)
 s Status=##Class(%SYS.LDAP).AddExts(LD,DN,Attributes,"","")
 i Status'=$$$LDAPSUCCESS w !,"AddExts error: "_Status_" - "_##Class(%SYS.LDAP).Err2String(Status) g LDAPError

You can see an example of that on LDAP.mac on Namespace Samples.

I hope that helped you

Another option is to use a regular expression, like this:

ClassMethod ReplaceAccents(ByRef pWord As %String) As %Status
{
  Set tSC = $$$OK
  Try {
      Set dictionary = ##class(%ArrayOfDataTypes).%New()
      Do dictionary.SetAt("ÀÁÂÃÄÅ","A")
      Do dictionary.SetAt("àáâãäå","a")
      Do dictionary.SetAt("ÈÉÊË","E")
      //.... all the rest
   
      While dictionary.GetNext(.key) {
        Set matcher = ##class(%Regex.Matcher).%New("["_ dictionary.GetAt(key) _ "]", pWord)
        Set pWord = matcher.ReplaceAll(key)
      }
  Catch tException {
    Set:$$$ISOK(tSC) tSC = tException.AsStatus()
  }
  Quit tSC
}