OS/2, eCS & ArcaOS - Technical > Applications

Start a program using utf-8 as system codepage

(1/2) > >>

Remy:
Hi,

Is there a was to start a program in an OS/2 env using utf-8 codepage ?
Under RXULS inf doc, os/2 supported codepage are listed but the corresponding utf-8 isn't supported as default or alternate os/2 env codepage.

Waiting suggestions.

Traget: Read utf-8 chars like japanese or other specific characters not having a readable code under default 850 codepage from audio metadatas.

Dave Yeo:
Use an editor that can display unicode such as Alex's qe.exe or featherpad. Or a browser.

Alex Taylor:
OS/2 doesn't support UTF-8 as a process codepage. 

It does support it as a PM message-queue codepage, but this has to be set after the program starts up and creates a message queue.  You can force a change to a running PM app's message-queue codepage using CPPal (https://hobbes.nmsu.edu/?detail=%2Fpub%2Fos2%2Futil%2Fwps%2FCpPal_0-30.zip) - in most cases this requires you to also reset the window font afterwards (e.g. using the Font Palette) to force a refresh.

However, this technique has limited usefulness, mainly because the standard PM controls aren't really designed to handle UTF-8. Static text controls may be semi-legible, but text fields will probably just show an unreadable overlapping mess.

UTF-8 (1208) is supported as a GPI direct-rendering codepage, but it's apparently poorly optimized because rendering speed is atrociously slow. Raw UCS-2 (1200) is much faster to render in GPI, so in most cases it's better to internally convert UTF-8 to UCS-2 and render it that way. I once started to write a MLE control that could support Unicode encoded text (the source, such as it is, is still somewhere on my Github site), but I eventually found it was easier to just use Qt.

In most cases, if you want to render UTF-8 text (or any Unicode encoded text, actually) it's almost always preferable to use an alternative rendering library based on FreeType, like Cairo or Pango, as Qt and the Mozilla apps do. 

Martin Iturbide:
FYI: On the latest Warpstock Alex taught me how to use CpPal and I documented here to don't forget it: "Displaying an Application with Japanese Characters Correctly"

Regards

Remy:

--- Quote from: Dave Yeo on February 11, 2023, 02:54:08 am ---Use an editor that can display unicode such as Alex's qe.exe or featherpad. Or a browser.

--- End quote ---

How will PM123 display these audio metadatas ?

Navigation

[0] Message Index

[#] Next page

Go to full version