WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Foreign Language Support of the Win32 Network Extender

 Keywords: Foreign Language Unicode Double Byte 

Question:

We use wntAcctList() to spool the list of users from Windows 2000 / Windows 2003 and Windows 2008.

Created a chinese user id, but after I ran the function wntAcctList('',1,0) to get a list of users I get back the following:

	??,??????

The English characters display just fine.

Answer:

Most of the newer extender functions primarily use the Unicode versions of Win32 API functions. But some of the older extender functions still use the ANSI versions of Win32 API functions. We did an analysis of the extender's source code to assess the "Unicode readiness" about 2 years ago, and the result was that between 65% and 75% of the code was using narrow strings in local code page, with conversion to/from Unicode strings when necessary to interface with a Unicode version of a Win32 API function.

At this point, even though WinBatch now has native support for Unicode strings, the Win32 Network extender itself would require a fair amount of refactoring & testing to implement full Unicode support within it. There is no quick fix that will enable reliable Unicode support within the extender.

Currently, we recommend using the WMI and ADSI COM Automation interfaces for the account management operations. There are very few cases where the extender performs tasks that cannot be performed via WMI or ADSI.

For Example, here is some code to get a user list that contains mutlibyte characters using ADSI COM.


#DefineFunction udfListUsers( strDomain )
   ; List all users and some of their properties in a Windows 2000 AD domain or
   ; Windows NT4 domain. If domain is a computer, all users of the local SAM ; database are displayed.
   objComputer = ObjectGet ("WinNT://" : strDomain )
   objComputer.Filter = "User"
   list = ''
   ForEach objUser In objComputer
     list = list : @TAB :  objUser.Name
   Next
   Return StrTrim(list)
#EndFunction

strDomain = AskLine( "List users", "Please enter a domain name",  ComputerNameGet( 0 ) )
list = udfListUsers( strDomain )

Article ID:   W17994
Filename:   Foreign Language support of the Win32 Network Extender.txt
File Created: 2009:05:22:12:26:36
Last Updated: 2009:05:22:12:26:36