Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <mbstring.h>
    unsigned int _mbctombb( unsigned int ch );

Description:
    The _mbctombb function returns the single-byte character equivalent to
    the double-byte character ch.  The single-byte character will be in the
    range 0x20 through 0x7E or 0xA1 through 0xDF.

    Note:  This function was called  zentohan in earlier versions.

Returns:
    The _mbctombb function returns ch if there is no equivalent single-byte
    character; otherwise _mbctombb returns a single-byte character.


Example:
    #include <stdio.h>
    #include <mbctype.h>
    #include <mbstring.h>

    #define ZEN(x) 130*256+(x-1+32)

    unsigned int alphabet[26] = {
        ZEN('A'),ZEN('B'),ZEN('C'),ZEN('D'),ZEN('E'),
        ZEN('F'),ZEN('G'),ZEN('H'),ZEN('I'),ZEN('J'),
        ZEN('K'),ZEN('L'),ZEN('M'),ZEN('N'),ZEN('O'),
        ZEN('P'),ZEN('Q'),ZEN('R'),ZEN('S'),ZEN('T'),
        ZEN('U'),ZEN('V'),ZEN('W'),ZEN('X'),ZEN('Y'),
        ZEN('Z')
    };

    #define SIZE sizeof( alphabet ) / sizeof( unsigned int )

    void main()
      {
        int             i;
        unsigned int    c;

        _setmbcp( 932 );
        for( i = 0; i < SIZE; i++ ) {
          c = _mbctombb( alphabet[ i ] );
          printf( "%c", c );
        }
        printf( "\n" );
      }

    produces the following:

    ABCDEFGHIJKLMNOPQRSTUVWXYZ

Classification:
    WATCOM

Systems:
    DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    _getmbcp, _mbbtombc, _mbcjistojms, _mbcjmstojis, _ismbbalnum,
    _ismbbalpha, _ismbbgraph, _ismbbkalnum, _ismbbkalpha, _ismbbkana,
    _ismbbkprint, _ismbbkpunct, _ismbblead, _ismbbprint, _ismbbpunct,
    _ismbbtrail, _mbbtombc, _mbcjistojms, _mbcjmstojis, _mbbtype, _setmbcp

See Also: _getmbcp _mbbtombc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson