Home All Groups Group Topic Archive Search About

Losing accented characters getting account names from system

Author
28 Jun 2006 3:42 AM
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

Author
28 Jun 2006 4:49 AM
Cor Ligthert [MVP]
Jack,

Probably the code page setting of those laptops, have a look at these pages

In general
http://www.microsoft.com/globaldev/reference/cphome.mspx
OS systems
http://www.microsoft.com/globaldev/reference/oslocversion.mspx


I hope this helps,

Cor

Show quoteHide quote
"Jack Russell" <ja***@norubbish.tpg.com.au> schreef in bericht
news:%23izXwTmmGHA.3352@TK2MSFTNGP02.phx.gbl...

>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
Author
28 Jun 2006 5:24 AM
Jack Russell
Thanks Cor, I will let you know

Cor Ligthert [MVP] wrote:
Show quoteHide quote
> Jack,
>
> Probably the code page setting of those laptops, have a look at these pages
>
> In general
> http://www.microsoft.com/globaldev/reference/cphome.mspx
> OS systems
> http://www.microsoft.com/globaldev/reference/oslocversion.mspx
>
>
> I hope this helps,
>
> Cor
>
> "Jack Russell" <ja***@norubbish.tpg.com.au> schreef in bericht
> news:%23izXwTmmGHA.3352@TK2MSFTNGP02.phx.gbl...
>
>
>>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
>
>
>
Author
28 Jun 2006 7:16 AM
Jack Russell
Cor,

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

Any other ideas?

Thanks

Jack


Cor Ligthert [MVP] wrote:
Show quoteHide quote
> Jack,
>
> Probably the code page setting of those laptops, have a look at these pages
>
> In general
> http://www.microsoft.com/globaldev/reference/cphome.mspx
> OS systems
> http://www.microsoft.com/globaldev/reference/oslocversion.mspx
>
>
> I hope this helps,
>
> Cor
>
> "Jack Russell" <ja***@norubbish.tpg.com.au> schreef in bericht
> news:%23izXwTmmGHA.3352@TK2MSFTNGP02.phx.gbl...
>
>
>>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
>
>
>
Author
28 Jun 2006 7:24 AM
Jack Russell
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


Jack Russell wrote:
Show quoteHide quote
> Cor,
>
> Compared the code pages between working and non working, the non working
> actually had more!
>
> Any other ideas?
>
> Thanks
>
> Jack
>
>
> Cor Ligthert [MVP] wrote:
>
>> Jack,
>>
>> Probably the code page setting of those laptops, have a look at these
>> pages
>>
>> In general
>> http://www.microsoft.com/globaldev/reference/cphome.mspx
>> OS systems
>> http://www.microsoft.com/globaldev/reference/oslocversion.mspx
>>
>>
>> I hope this helps,
>>
>> Cor
>>
>> "Jack Russell" <ja***@norubbish.tpg.com.au> schreef in bericht
>> news:%23izXwTmmGHA.3352@TK2MSFTNGP02.phx.gbl...
>>
>>
>>> 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
>>
>>
>>
>>
Author
28 Jun 2006 8:19 AM
Cor Ligthert [MVP]
> I am sure there is more to it but really do not want to know.

LOL