라벨이 dbcs인 게시물 표시

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #4 Epilogue

So far, we've researched the ways to enable DBCS environment on SBCS OS/2. First was how to configure OS/2. Second was how to display DBCS characters. Third was how to input DBCS characters. Neverthless, however, it is not possible to set DBCS environment up on SBCS OS/2, perfectly. Of course, the best and perfect way is to provide DBCS OS/2. However, if it's not possible, then resource corruption of eWP on DBCS code pages should be fixed , at least. eCo Software has been working on the Language Interface Pack project( http://en.ecomstation.ru/projects/lip/ ) which enables to switch messages and texts of eComStation to the localized messages and texts. Support for this project will be also helpful to DBCS users as well as SBCS users. I wish DBCS users use the latest OS/2 without any restrictions.

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #3 Input DBCS characters

The last step is to enable input DBCS characters. DBCS OS/2 provides a special program, IME(Input Method Editor), to input DBCS characters. Of course, SBCS OS/2 does not. But, there are several ways to input DBCS characters. 1. Web IME Web IME is the web service provides IME. In this case, it's not possible to input DBCS characters to a window directly. Instead, you should use COPY-AND-PASTE. 1.1 InputKing ( http://www.inputking.com/ ) This web IME supports various languages such as European, Russian and Indian as well as Chinese, Japan, Korean and Vietnamese. 2. Native IME Native IME is an OS/2 program to provide IME. But not all IMEs support to input DBCS characters directly. 2.1.Chinese 2.1.1 Bridge2-Hi ( https://www.arcanoae.com/shop/bridge2-hi/ ) This program supports to input Chinese characters, Hanzi. This is not free. 2.2. Japanese 2.2.1 IMERJ ( http://www.altsan.org/programming/os2/index.html#imerj ) This program supports to input Japanese char...

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #2 Display DBCS characters

Displaying DBCS characters on SBCS requires at least two things. First is a font driver supporting UNICODE fonts correctly, second is fonts themselves for DBCS. Other than these, there are some other things needed. 1. Font Driver Nowadays, most of fonts are True Type Font. OS/2 also supports it. However, default true type font driver does not support unicode fonts correctly. Especially, DBCS fonts. So if you want to use DBCS fonts, you should install another font driver for a true type font. It's <FreeType/2> . FreeType/2 has several versions. 1.0.x and 1.1.x released by Michael Necasek, 1.2.x released by me, 1.3.x and 2.x released by Alex Taylor. Out of these, you should use 1.2.x or later. You can get them here. FreeType/2 1.2.x: http://www.ecomstation.co.kr/komh/os2factory/#freetype2 FreeType/2 IFI 1.3.x and 2.x: http://www.altsan.org/programming/os2/index.html#ft2 For installations, see their README. 2. Font IBM provided fonts containing CJK glyphs by ...

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #1 Configuration

이미지
The first step to enable DBCS environment is to configure your system. 1. CODEPAGE statement OS/2 is a system based on a code page. You can specify two code pages.  For example, you can see the line like following in config.sys CODEPAGE=850,437 First is a primary code page, which is used by processes by default. Second is a secondary code page, which is an auxiliary code page used by some processes on demand. To enable DBCS environment, you should add a DBCS code page which you want to use to CODEPAGE as a primary or a secondary. For example, CODEPAGE=850,949 949 is a Korean code page. Like this, adding a DBCS code page as a secondary code page is most safe. Because if a DBCS code page is used as a primary code page, 1. You will see an error like this on every boot. SYS1729: The code page 949 is not acceptable for the display. Press Enter to continue... 2. Some programs may conflict with DBCS code pages. For example, some resources of eWP is corrupted like th...

OS/2 tricks: How to set up DBCS environment on SBCS OS/2 #0 Prologue

There are two versions on OS/2 according to the locale. One is SBCS version, and the other one is DBCS version. Still OS/2 does not support unicode as a base system character set. This separation is also inherited by OEM versions such as eComStation and ArcaOS. However, those OEMs lacks DBCS version. Although it was known that beta versions of DBCS eComstation was there, I know, GA version has not been released at all. So if you want to use DBCS version of OS/2, then you should use old-good OS/2 up to MCP2. Even MCP2 of DBCS OS/2 does not support some countries such as Korea. As a result, DBCS users who want to use the latest OS/2 including OEMs, should use SBCS OS/2. Then, is it possible to use DBCS features on SBCS OS/2 ? Yes, but partially. Afterwards, let's find the ways.

OS/2 codes: How to support DBCS #5 Level 3 application(Full-IME)

So far, we've found the way to support DBCS without consideration of IME itself. They are called level 1 application. Level 1 applications are useful. However, they still lack something. Because, a conversion window is not integrated to a working window. For example, let's consider a word processor program. On level 1 application, a size and a type of a font of a conversion window are different from ones in a working window. This looks ugly and uncomfortable. In addition, level 1 applications use over-the-spot input type. That is, a conversion window shows up over a underlying text. Users cannot see the texts under the conversion window until a conversion is completed. In this article, let's find to make level 3 applications, which use IME fully. Making Level 3 Applications To make level 3 applications, you neede OS/2 ToolKit v4.5 or later. And when linking a program, you need to link against os2im.lib . Make sure to add os2tk45/h to C_INCLUDE_PATH and to add os2tk...

OS/2 codes: How to support DBCS #4 Process WM_QUERYCONVERTPOS

이미지
WM_QUERYCONVERTPOS is sent in order to query a position of a conversion window and a candiate window. However, an application is not aware of IME and not needed to control IME at all. Let's see a syntax of WM_QUERYCONVERTPOS. This message is sent by an application to determine whether it is appropriate to begin conversion of DBCS characters. param1 PRECTL pCursorPos /* Cursor position. */ param2 ULONG ulReserved /* Reserved value, should be 0. */ This message may return QCP_CONVERT or QCP_NOCONVERT. If you return QCP_NOCONVERT, then an window does not receive DBCS characters. That is, this has an effect to disable IME. If you return QCP_CONVERT, then an window receives DBCS characters. In this case, [pCursorPos] should be updated. [pCursorPos->xLeft] and [pCursorPos->yBottom] is a bottom-left corner of a conversion window and a upper-left corner of a candidate window. [pCursorPos->xRight] and [pCursorPos-yTop] is a upper-right corner of a ...

OS/2 codes: How to support DBCS #3 Process WM_CHAR

On PM, users' key inputs are delivered with WM_CHAR message. First see a syntax of WM_CHAR. This message is sent when an operator presses a key. param1 USHORT fsflags /* Keyboard control codes. */ UCHAR ucrepeat /* Repeat count. */ UCHAR ucscancode /* Hardware scan code. */ param2 USHORT usch /* Character code. */ USHORT usvk /* Virtual key codes. */ Here, the relavant things are [fsflags](=SHORT1FROMMP(mp1)), [ucscancode](=CHAR4FROMMP(mp1)) and [usch](=SHORT1FROMMP(mp2)). A DBCS character consists of two bytes. So do not assume that [usch] is a single-byte. Then what is the way to distinguish a SBCS character and a DBCS character ? Check a high-byte of [usch]. If it is 0, then a SBCS character, or a DBCS character. If it is a DBCS character, its low-byte is a lead-byte and its high-byte is a trail-byte. You can access these bytes of [usch] with several ways. First is to use [usch] itself. In this case,...

OS/2 codes: How to support DBCS #2 Manipulate DBCS strings

Unlike SBCS, a DBCS(double-byte character set) character consist of two bytes as its name. ^^ So manipulating DBCS strings needs some different works. For example, strlen() returns a length of a string in bytes not in characters. And if walking through DBCS strings, indice should be moved by 2 bytes. To solve the above problems, the most basic is to get an information of DBCS lead-bytes. Here, a lead-byte is first byte of a DBCS character. And second byte is called a trail-byte. On OS/2, there are two ways to do this. One is DosQueryDBCSEnv() , and the other is UniQueryUconvObject() . Using these functions, it is possible to determine a chracter is a SBCS character or a DBCS character. DosQueryDBCSEnv() give a vector of ranges of lead-bytes. Whereas, UniQueryUconvObject() give a vector of a char size in according to a lead-byte. If you prefer compatibility, then use DosQueryDBCSEnv() . If got a information for lead-bytes, now what to do is to determine if a DBCS character. This...

OS/2 codes: How to support DBCS #1 Determine if DBCS env

Most of OS/2 users are in SBCS countries. Naturally, many OS/2 programs are developed in their countries. And those programs lack DBCS support. To begin with this article, I'll write a series of articles for DBCS support. How to determine if DBCS environment OS/2 is based on a code page. And OS/2 provides many APIs for a code page. Out of these, you can use DosQueryDBCSEnv() to determine if DBCS environment because DBCS code pages provides the ranges of DBCS lead-bytes. This is a syntax for DosQueryDBCSEnv(). Obtains a DBCS (double-byte character set) environmental vector that resides in the country file. #define INCL_DOSNLS #include <os2.h> ULONG cb ; /* The length, in bytes, of the data area ( pBuf ) provided by the caller. */ PCOUNTRYCODE pcc ; /* A pointer to the COUNTRYCODE structure in which the country code and code page are identified. */ PCHAR pBuf ; /* The data area where the country-dependent information for the DBCS ...