BBC BASIC for Windows
« Unicode in dialog boxes »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:52pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Unicode in dialog boxes  (Read 333 times)
JB91
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 47
xx Unicode in dialog boxes
« Thread started on: Dec 29th, 2011, 4:36pm »

Hi,

How would you be able to put unicode strings in a static control in a dialog box? I've tried changing it into UTF-8, but it doesn't work.

Josh.
« Last Edit: Dec 29th, 2011, 4:36pm by JB91 » User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Unicode in dialog boxes
« Reply #1 on: Dec 29th, 2011, 5:15pm »

on Dec 29th, 2011, 4:36pm, JB91 wrote:
How would you be able to put unicode strings in a static control in a dialog box? I've tried changing it into UTF-8, but it doesn't work.

Windows controls don't support UTF-8 natively; they only take UTF-16. You can convert the UTF-8 string to UTF-16 and send it to the static control as follows (requires BB4W v5.93a):

Code:
      L% = LEN(utf8$)+1
      utf16$ = STRING$(2*L%, CHR$0)
      SYS "MultiByteToWideChar", CP_UTF8, 0, utf8$, -1, utf16$, L%
      SYS "SetDlgItemTextW", !dlg%, idstatic%, utf16$ 

You will also need to ensure that a Unicode font is selected.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls