Losing accented characters getting account names from system

  • Thread starter Thread starter Jack Russell
  • Start date Start date
J

Jack Russell

I have the following code in VB .net 2003
s = "Select * from Win32_UserAccount WHERE Domain =""" +
Environment.MachineName.ToString + """"
moSearch = New Management.ManagementObjectSearcher(s)
moReturn = moSearch.Get
For Each mo In moReturn
Try
If mo("disabled").ToString = "False" Then
cboUsers.Items.Add(mo("name"))
End If
Catch e As Exception
ReportBug(e, "makinguserlist in
programoptions_initform")
End Try
Next

On some PCs (usually laptops) if the name contains any accented
characters (äüöéèà) those characters are lost.

Any ideas, the PCs in question can display those characters elsewhere

Thanks

Jack Russell
 
Cor,

Compared the code pages between working and non working, the non working
actually had more!

Any other ideas?

Thanks

Jack
 
Turns out to be a Windows bug. My user had created his user name by
renaming an existing name. for some reason this does not always return
the new user name. I am sure there is more to it but really do not want
to know.

Jack Russell
 
Back
Top