Glenn Maynard wrote:
> On Thu, May 06, 2004 at 06:26:01PM +0200, Bram Moolenaar wrote:
> > > Apparently some, but not all, code paths that should use "Wide"
> > > versions of the Win32 API have now been converted from ANSI to Wide.
> > > There is an interesting discrepancy left, however. In the following
> > > I'm using "ÃÂ¥ÃÂ¤ÃÂ¶.txt" as a filename.
> If you want to test wide characters, you need to use characters that
> aren't included in your ANSI codepage, eg. "æ¥æ¬èª".
> > Those are latin1 characters, in case someone was wondering. non-latin1
> > characters still have the problem that they appear as question marks in
> > the title for me. Don't know how to solve that.
> You have to create the a wide window class.
> Instead of setting up WNDCLASS and calling RegisterClass, first set up
> and WNDCLASSW and call RegisterClassW.
> If it fails with ERROR_CALL_NOT_IMPLEMENTED, set up the regular WNDCLASS
> as usual (for Win9x).
> Finally, at the bottom of your WndProc, call DefWindowProcW instead of
> DefWindowProcA if RegisterClassW was used.
> This makes the window capable of displaying Unicode text in the titlebar;
> otherwise, even if you pass Unicode data in, the low-level internal stuff
> that actually draws the text will just print "?".
> That should be enough to make SetWindowTextW work. (Of course, a
> fallback on SetWindowTextA on ERROR_CALL_NOT_IMPLEMENTED is also needed.)
Great, that is the hint I needed. I'll try searching for a bit of
example code, especialy for handling the errors.
> It's not a lot of work, but as there are plenty of other places that don't
> use wide system calls, I didn't bother fixing it.
Generally using utf-8 for 'encoding' is a good thing to do on the long
term. I'm trying to remove all disadvantages, so that using utf-8 will
become the generic solution to problems with encodings, on all systems
in all environments.
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
"empty recycle bin" button.
/// Bram Moolenaar -- Bram@...
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/
\\\ Project leader for A-A-P -- http://www.A-A-P.org
\\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html