mbcjisto.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 60 行

GML
60
字号
.func _mbcjistojms
#include <mbstring.h>
unsigned int _mbcjistojms( unsigned int ch );
.funcend
.desc begin
The &func converts a JIS character set code to a shift-JIS character
set code.
If the argument is out of range, &func returns 0.
Valid JIS double-byte characters are those in which the first and
second byte fall in the range 0x21 through 0x7E.
This is summarized in the following diagram.
.millust begin
   [ 1st byte ]    [ 2nd byte ]
    0x21-0x7E       0x21-0x7E
.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 personal computers 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 alphanumeric codes.
Thus the double-byte shift-JIS codes are greater than or equal to
0x8140.
.np
.us Note:
This function was called
.kw jistojms
in earlier versions.
.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
.im seeismbb &function.
.see end
.exmp begin
#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>

void main()
  {
    unsigned short c;

    _setmbcp( 932 );
    c = _mbcjistojms( 0x2152 );
    printf( "%#6.4x\n", c );
  }
.exmp output
0x8171
.exmp end
.class WATCOM
.system

⌨️ 快捷键说明

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