⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jmstojis.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
字号:
.func jmstojis
#include <jstring.h>
unsigned short jmstojis( unsigned short msc );
.ixfunc2 '&CharTest' &func
.funcend
.desc begin
The &func converts a shift-JIS character set code to a JIS character
set code.
If the argument is out of range, &func returns 0.
Valid shift-JIS double-byte characters are those in which the first
byte falls in the range 0x81 - 0x9F or 0xE0 - 0xFC and whose second
byte falls in the range 0x40 - 0x7E or 0x80 - 0xFC.
This is summarized in the following diagram.
.millust begin
   [ 1st byte ]    [ 2nd byte ]
    0x81-0x9F       0x40-0xFC
        or          except 0x7F
    0xE0-0xFC
.millust end
.np
.us Note:
The JIS character set code is a double-byte character set defined by
JIS, the Japan Industrial Standard Institutes.
Shift-JIS is another double-byte character set.
It is defined by Microsoft for MS/DOS and is based on the JIS code.
The first byte and the second byte of JIS codes can have values less
than 0x80.
Microsoft has designed shift-JIS code so that it can be mixed in
strings with single-byte alpha-numeric codes.
Thus the double-byte shift-JIS codes are greater than or equal to
0x8140.
.desc end
.return begin
The &func function returns zero if the argument is not in the range;
otherwise, the corresponding shift-JIS code is returned.
.return end
.see begin
.seelist &function. jistojms jmstojis
.see end
.exmp begin
#include <stdio.h>
#include <jstring.h>

void main()
  {
    unsigned short c;
.exmp break
    c = jmstojis( 0x8171 );
    printf( "%x\n", c );
  }
.exmp output
2152
.exmp end
.class WATCOM
.system

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -