Hi Rhett
To no avail.
Setting the CultureInfo to fr got me the error: Culture "fr" is a neutral
culture. It can not be used in formatting and parsing and therefore cannot
be set as the thread's current culture. So I set it to "fr-FR" just to prove
setting the culture is not the right solution, and I get the same results .
It's not how the strings are put on screen, even in Debug mode when
switching to binary mode I don't see 4 but 3 characters for René (Ren). ,
and unless I get a byte array back or am able to set the encoding for the
string conversion of DirectoryServices Using ADsGetObject will certainly
work, it's just that the .NET way shows regression or less functionality and
it is a reason not to switch to .NET. I'm looking at a showstopper for this
project. The strings in the LDAP are encoded in UTF7. Changing the LDAP to
UTF8 is also no option, as a lot of legacy application still rely on UTF7
and don't understand UTF8.
So could you please forward this to the people within the .NET group
responsible for DirectoryServices as a feature request/bug report? Too bad
me or others haven't spotted this behavior during the last 2 beta trails of
..NET 1.0 and 1.1. So what I would want is the raw Byte array in stead of a
wrongly decoded string value, or give a hint to DirectoryServices on the
decoding scheme. Else how could you retrieve binary information from LDAP
with .NET if you would only get back a string?
Thanks,
Peter Aragon
Rhett Gong said:
Hi,
1> use following lines (unmanaged code) to see if you can get the full
charaters especially 0xE9 returned at your client with different locale
setting.
//--------------------------------------------------------------------------
ADsGetObject(L"LDAP://test.microsoft.com/CN=Ren¨¦,CN=Users,DC=Test,DC=micros
oft,DC=com",IID_IADs, (void **) & oUsr);
oUsr->Get(L"cn",&pProp);
//--------------------------------------------------------------------------
-------
2> using .net DirectoryServices: apply this code to see if it could resolve your problem,
//-----------------------------------------------------------------
// negotiate with ldap server what locale it used. Assume it is Franch, then try following code.
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr",true);
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr",true);
//-----------------------------------------------------------------------
Please apply my suggestions and let me know your result. Thanks.
Have a nice day!
Rhett Gong [MSFT]
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.