realbasic-nug
[Top] [All Lists]

Re: Encoding problem?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Encoding problem?
From: Greg Bowman <detour at drivetimeart dot com>
Date: Sun, 30 Apr 2006 19:57:37 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <BE93E7C0-876F-4B6B-828E-02CD2C23F72A at kellerfarm dot com> <bdeb0faa3dd0af31cf22d21185de6eb0 at realsoftware dot com>
Yep, I had exactly the same problem, though I was using the Einhugur plugin. Jon's code should work, but I had problems sticking with just the DefineEncoding, so I ended up using ConvertEncoding which did the trick.

Greg


On Apr 30, 2006, at 5:11 PM, Jonathan Johnson wrote:


On Apr 30, 2006, at 6:28 PM, andrew at kellerfarm dot com wrote:

I am trying to get the name of the user that is logged in in Windows using the method available in the Windows Functionality Suite, but the result is not behaving as I expect. It looks like there's a character between every character that I expect, and it is causing major problems with displaying - for example, in a message box, only the text before the unexpected character is displayed. Could this be an encoding problem? How do I fix this?

Yes. It sounds like the data is being returned as UTF-16, but the encoding is set incorrectly.

Try this:

dim s as String = DefineEncoding( whateverTheFunctionCallIs(), Encodings.UTF16 )

Of course, if this is the problem, be sure to email <aaron at aaronballman dot com> which function(s) isn't/aren't behaving correctly.

HTH,
Jon


--
Jonathan Johnson
REAL Software, Inc.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>