Announcement

Collapse
No announcement yet.

Unicode?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unicode?

    Since I saw a post mentioning Ansi, I began to wonder about Unicode. Does PB/DLL 6.0 support Unicode? Would be neat, because it would enable me to use Chinese in my programs.

    Best regards,

    Harmen.
    ------------------------------------ http://home.wanadoo.nl/harmen.mesker
    ------------------------------------

  • #2
    Not natively. You must handle all Unicode string processing yourself because the PB string engine is not Unicode-aware. Windows 95 and 98 do not support Unicode-aware API functions either, so you are limiting your app's to NT.

    -------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Hi Lance,

      Thank you for your reply. I always thought that Windows 98 also supported Unicode, I guess I mixed op Office 2000 and Windows, because Office 2000 _does_ support Unicode.

      But I went searching on the site of Microsoft, and came across this lengthy article:
      http://www.microsoft.com/msj/default...unicodetop.htm

      ...which discusses how to enable Unicode under Windows 9x. Would you do me a favour and read this, and if possible comment on it? Because the article goes way over my head, and uses C-code for example programmings. Is it possible to implement what the writer is saying in PB? I'll read the article again thoroughly, but maybe you can help me with it.

      Best regards,

      Harmen.

      Comment


      • #4
        I only scanned the article and the key seems to be captured with the statement
        The approach I'll discuss here runs as a pure Unicode application on Windows NT, but as an ANSI application with conversion as appropriate on Windows 9x.
        The DLL discussed simply (and dynamically) calls the appropriate Unicode or Ansi API functions as necessary... in other words, a whole lot of extra code and overhead just to have a single set of source code that runs as either Unicode or Ansi depending on the platform... it futher states:
        Figure 2 reveals some important considerations in implementing this approach. First, let's state the obvious: since RegisterClassExAU eventually calls RegisterClassExA to register window classes, the application runs as an ANSI application. This is necessary, of course, since the Unicode version RegisterClassExW will fail on Windows.
        Therefore this technique is not enabling the creation of a Unicode app on Windows 95 or 98.

        My impression is that it is technically possible to to this with PB/DLL, but I have to ask: is it going to me worth it? Only you, the programmer, can answer that depending on how much you need this "flexibility". Not to mention that the DLL code (to handle the dynamic linking to the appropriate API) will be huge! The performance "hit" in Windows 9x could also be significant because of the constant Ansi->Wide and Wide->Ansi conversions.

        The article also mentions some of the difficulties when dealing with some of the Win9x API's that internally can only use Ansi...

        It rapidly gets too complex and time consuming for me to consider... YMMV.



        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          Does this mean that PB/DLL will never natively support Unicode, even though it is fast becoming the standard for Windows, especially with Windows 2000?
          If you try to make something idiot-proof, someone will invent a better idiot.

          Comment


          • #6
            Anything is possible...! If R&D receive enough requests for Unicode support, then it stands a greater chance of being implemented.

            Send your wishes to mailto:[email protected][email protected]</A>



            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment

            Working...
            X