Từ 1 tới 5 trên tổng số 5 kết quả

Đề tài: Tiếng việt và C thuần túy - Cách gõ tiếng việt trên DOS 16bit

  1. #1
    Ngày gia nhập
    06 2007
    Nơi ở
    C:\WINDOWS\system32\dllcache\
    Bài viết
    3,007

    Mặc định Tiếng việt và C thuần túy - Cách gõ tiếng việt trên DOS 16bit

    1. khởi tạo chế độ tiếng việt trong C for dos. vấn đề này thì DR đã nói rồi.
    langman mạn phép được pót lại của DR về vấn đề này :
    C Code:
    1. void tiengviet(void)
    2. {
    3.      int    i, j;
    4.      char    vnfont[16*256] = {
    5.      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    6.      24,24,24,24,24,24,24,248,0,0,0,0,0,0,0,0,
    7.      240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
    8.      255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,
    9.      0,254,2,3,63,3,3,3,3,3,3,3,255,255,0,0,
    10.      0,254,254,254,254,126,62,30,14,6,254,254,254,254,254,0,
    11.      255,1,1,1,1,1,1,249,249,1,1,1,1,1,1,255,
    12.      0,0,0,0,0,0,24,60,60,24,0,0,0,0,0,0,
    13.      0,255,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
    14.      0,254,254,126,62,30,14,6,126,126,126,126,126,254,254,0,
    15.      0,254,254,126,126,126,126,126,6,14,30,62,126,254,254,0,
    16.      0,0,248,4,254,2,3,3,3,3,3,3,255,255,0,0,
    17.      255,128,129,131,135,143,159,191,131,131,131,131,131,128,128,255,
    18.      0,254,2,3,3,255,3,3,3,3,3,3,255,255,0,0,
    19.      0,254,2,115,131,131,131,115,3,3,3,3,255,255,0,0,
    20.      0,254,2,3,195,67,251,67,195,3,3,3,255,255,0,0,
    21.      0,0,64,96,112,120,124,126,124,120,112,96,64,0,0,0,
    22.      0,0,1,3,7,15,31,63,31,15,7,3,1,0,0,0,
    23.      0,254,2,243,139,243,147,139,3,3,3,3,255,255,0,0,
    24.      0,254,2,251,131,243,131,251,3,3,3,3,255,255,0,0,
    25.      255,1,125,125,171,215,239,239,239,215,187,109,85,41,1,255,
    26.      0,254,130,130,130,84,40,16,16,40,68,130,170,214,254,0,
    27.      0,0,0,0,0,0,0,255,24,24,24,24,24,24,24,24,
    28.      0,1,3,2,6,4,12,136,216,80,112,32,0,0,0,0,
    29.      0,0,0,0,8,28,62,127,28,28,28,28,0,0,0,0,
    30.      0,0,0,0,28,28,28,28,127,62,28,8,0,0,0,0,
    31.      0,0,0,0,0,0,24,12,254,12,24,0,0,0,0,0,
    32.      0,0,0,0,0,0,48,96,254,96,48,0,0,0,0,0,
    33.      0,127,126,124,127,111,79,0,0,79,111,127,124,126,127,0,
    34.      0,126,62,30,126,118,114,0,0,114,118,126,30,62,126,0,
    35.      0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
    36.      255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
    37.      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    38.      0,0,0,0,24,60,60,60,24,24,0,24,24,0,0,0,
    39.      0,0,0,102,102,102,36,0,0,0,0,0,0,0,0,0,
    40.      0,0,0,0,108,108,254,108,108,108,254,108,108,0,0,0,
    41.      0,0,24,24,124,198,194,192,124,6,134,198,124,24,24,0,
    42.      0,0,0,0,0,0,194,198,12,24,48,102,198,0,0,0,
    43.      0,0,0,0,56,108,108,56,118,220,204,204,118,0,0,0,
    44.      0,0,0,48,48,48,96,0,0,0,0,0,0,0,0,0,
    45.      0,0,0,0,12,24,48,48,48,48,48,24,12,0,0,0,
    46.      0,0,0,0,48,24,12,12,12,12,12,24,48,0,0,0,
    47.      0,0,0,0,0,0,102,60,255,60,102,0,0,0,0,0,
    48.      0,0,0,0,0,0,24,24,126,24,24,0,0,0,0,0,
    49.      0,0,0,0,0,0,0,0,0,0,24,24,24,48,0,0,
    50.      0,0,0,0,0,0,0,0,254,0,0,0,0,0,0,0,
    51.      0,0,0,0,0,0,0,0,0,0,0,24,24,0,0,0,
    52.      0,0,0,0,2,6,12,24,48,96,192,128,0,0,0,0,
    53.      0,0,0,0,124,198,206,222,246,230,198,198,124,0,0,0,
    54.      0,0,0,0,24,56,120,24,24,24,24,24,126,0,0,0,
    55.      0,0,0,0,124,198,6,12,24,48,96,198,254,0,0,0,
    56.      0,0,0,0,124,198,6,6,60,6,6,198,124,0,0,0,
    57.      0,0,0,0,12,28,60,108,204,254,12,12,30,0,0,0,
    58.      0,0,0,0,254,192,192,192,252,6,6,198,124,0,0,0,
    59.      0,0,0,0,60,96,192,192,252,198,198,198,124,0,0,0,
    60.      0,0,0,0,254,198,6,12,24,48,48,48,48,0,0,0,
    61.      0,0,0,0,124,198,198,198,124,198,198,198,124,0,0,0,
    62.      0,0,0,0,124,198,198,198,126,6,6,12,120,0,0,0,
    63.      0,0,0,0,0,24,24,0,0,0,24,24,0,0,0,0,
    64.      0,0,0,0,0,24,24,0,0,0,24,24,48,0,0,0,
    65.      0,0,0,0,6,12,24,48,96,48,24,12,6,0,0,0,
    66.      0,0,0,0,0,0,0,126,0,0,126,0,0,0,0,0,
    67.      0,0,0,0,96,48,24,12,6,12,24,48,96,0,0,0,
    68.      0,0,0,0,124,198,198,12,24,24,0,24,24,0,0,0,
    69.      0,0,0,0,124,198,198,222,222,222,220,192,124,0,0,0,
    70.      0,0,0,0,16,56,108,198,198,254,198,198,198,0,0,0,
    71.      0,0,0,0,252,102,102,102,124,102,102,102,252,0,0,0,
    72.      0,0,0,0,60,102,194,192,192,192,194,102,60,0,0,0,
    73.      0,0,0,0,248,108,102,102,102,102,102,108,248,0,0,0,
    74.      0,0,0,0,254,102,98,104,120,104,98,102,254,0,0,0,
    75.      0,0,0,0,254,102,98,104,120,104,96,96,240,0,0,0,
    76.      0,0,0,0,60,102,194,192,192,222,198,102,58,0,0,0,
    77.      0,0,0,0,198,198,198,198,254,198,198,198,198,0,0,0,
    78.      0,0,0,0,60,24,24,24,24,24,24,24,60,0,0,0,
    79.      0,0,0,0,30,12,12,12,12,12,204,204,120,0,0,0,
    80.      0,0,0,0,230,102,108,108,120,108,108,102,230,0,0,0,
    81.      0,0,0,0,240,96,96,96,96,96,98,102,254,0,0,0,
    82.      0,0,0,0,198,238,254,254,214,198,198,198,198,0,0,0,
    83.      0,0,0,0,198,230,246,254,222,206,198,198,198,0,0,0,
    84.      0,0,0,0,56,108,198,198,198,198,198,108,56,0,0,0,
    85.      0,0,0,0,252,102,102,102,124,96,96,96,240,0,0,0,
    86.      0,0,0,0,124,198,198,198,198,214,222,124,12,14,0,0,
    87.      0,0,0,0,252,102,102,102,124,108,102,102,231,0,0,0,
    88.      0,0,0,0,124,198,198,96,56,12,198,198,124,0,0,0,
    89.      0,0,0,0,126,126,90,24,24,24,24,24,60,0,0,0,
    90.      0,0,0,0,198,198,198,198,198,198,198,198,124,0,0,0,
    91.      0,0,0,0,198,198,198,198,198,198,108,56,16,0,0,0,
    92.      0,0,0,0,198,198,198,198,214,214,254,124,108,0,0,0,
    93.      0,0,0,0,198,198,108,56,56,56,108,198,198,0,0,0,
    94.      0,0,0,0,102,102,102,102,60,24,24,24,60,0,0,0,
    95.      0,0,0,0,254,198,140,24,48,96,194,198,254,0,0,0,
    96.      0,0,0,0,60,48,48,48,48,48,48,48,60,0,0,0,
    97.      0,0,0,0,128,192,224,112,56,28,14,6,2,0,0,0,
    98.      0,0,0,0,60,12,12,12,12,12,12,12,60,0,0,0,
    99.      0,0,16,56,108,198,0,0,0,0,0,0,0,0,0,0,
    100.      0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,
    101.      0,0,48,48,24,0,0,0,0,0,0,0,0,0,0,0,
    102.      0,0,0,0,0,0,0,120,12,124,204,204,118,0,0,0,
    103.      0,0,0,0,224,96,96,120,108,102,102,102,124,0,0,0,
    104.      0,0,0,0,0,0,0,124,198,192,192,198,124,0,0,0,
    105.      0,0,0,0,28,12,12,60,108,204,204,204,118,0,0,0,
    106.      0,0,0,0,0,0,0,124,198,254,192,198,124,0,0,0,
    107.      0,0,0,0,56,108,100,96,240,96,96,96,240,0,0,0,
    108.      0,0,0,0,0,0,0,118,204,204,204,124,12,204,120,0,
    109.      0,0,0,0,224,96,96,108,118,102,102,102,230,0,0,0,
    110.      0,0,0,0,24,24,0,56,24,24,24,24,60,0,0,0,
    111.      0,0,0,0,6,6,0,14,6,6,6,6,102,102,60,0,
    112.      0,0,0,0,224,96,96,102,108,120,108,102,230,0,0,0,
    113.      0,0,0,0,56,24,24,24,24,24,24,24,60,0,0,0,
    114.      0,0,0,0,0,0,0,236,254,214,214,214,198,0,0,0,
    115.      0,0,0,0,0,0,0,220,102,102,102,102,102,0,0,0,
    116.      0,0,0,0,0,0,0,124,198,198,198,198,124,0,0,0,
    117.      0,0,0,0,0,0,0,220,102,102,102,124,96,96,240,0,
    118.      0,0,0,0,0,0,0,118,204,204,204,124,12,12,30,0,
    119.      0,0,0,0,0,0,0,220,118,102,96,96,240,0,0,0,
    120.      0,0,0,0,0,0,0,124,198,112,28,198,124,0,0,0,
    121.      0,0,0,0,16,48,48,252,48,48,48,54,28,0,0,0,
    122.      0,0,0,0,0,0,0,204,204,204,204,204,118,0,0,0,
    123.      0,0,0,0,0,0,0,102,102,102,102,60,24,0,0,0,
    124.      0,0,0,0,0,0,0,198,198,214,214,254,108,0,0,0,
    125.      0,0,0,0,0,0,0,198,108,56,56,108,198,0,0,0,
    126.      0,0,0,0,0,0,0,198,198,198,198,126,6,12,248,0,
    127.      0,0,0,0,0,0,0,254,204,24,48,102,254,0,0,0,
    128.      0,0,0,0,14,24,24,24,112,24,24,24,14,0,0,0,
    129.      0,0,0,0,24,24,24,24,0,24,24,24,24,0,0,0,
    130.      0,0,0,0,112,24,24,24,14,24,24,24,112,0,0,0,
    131.      0,0,0,0,118,220,0,0,0,0,0,0,0,0,0,0,
    132.      0,0,0,0,0,0,16,56,108,198,198,254,0,0,0,0,
    133.      0,0,0,0,0,0,124,198,192,192,198,124,24,12,248,0,
    134.      0,0,0,0,204,204,0,204,204,204,204,204,118,0,0,0,
    135.      0,0,0,0,108,108,0,120,12,124,204,204,118,0,0,0,
    136.      0,0,48,72,72,48,0,120,12,124,204,204,118,0,0,0,
    137.      0,0,0,0,108,108,0,124,198,254,192,198,124,0,0,0,
    138.      0,0,0,0,108,108,0,56,24,24,24,24,60,0,0,0,
    139.      0,0,0,24,60,102,0,56,24,24,24,24,60,0,0,0,
    140.      0,0,0,0,108,222,26,26,126,216,216,218,108,0,0,0,
    141.      0,0,0,0,204,204,0,124,198,198,198,198,124,0,0,0,
    142.      0,0,0,48,120,204,0,204,204,204,204,204,118,0,0,0,
    143.      0,0,0,0,198,198,0,198,198,198,198,126,6,12,120,0,
    144.      0,0,24,24,24,124,198,192,192,198,124,24,24,24,0,0,
    145.      0,0,0,56,108,100,96,240,96,96,102,230,188,0,0,0,
    146.      0,0,0,102,102,102,60,24,126,24,60,24,24,0,0,0,
    147.      0,0,0,252,102,102,124,98,102,111,102,102,243,0,0,0,
    148.      0,0,0,0,118,220,0,220,102,102,102,102,102,0,0,0,
    149.      0,0,0,0,0,0,54,108,216,108,54,0,0,0,0,0,
    150.      0,0,0,0,0,0,216,108,54,108,216,0,0,0,0,0,
    151.      0,0,0,0,24,24,24,126,24,24,24,0,126,126,0,0,
    152.      0,0,0,0,96,48,24,12,24,48,96,0,124,124,0,0,
    153.      0,0,0,0,12,24,48,96,48,24,12,0,124,124,0,0,
    154.      24,24,24,60,60,126,126,255,24,24,24,24,24,24,24,24,
    155.      24,24,24,24,24,24,24,24,255,126,126,60,60,24,24,24,
    156.      0,0,0,0,0,64,112,124,255,124,112,64,0,0,0,0,
    157.      0,0,0,0,0,2,14,62,255,62,14,2,0,0,0,0,
    158.      0,224,32,48,48,48,48,48,48,48,48,48,240,240,0,0,
    159.      255,128,128,128,128,128,128,159,159,128,128,128,128,128,128,255,
    160.      192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
    161.      255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    162.      0,240,24,28,30,30,3,3,3,3,3,3,255,255,0,0,
    163.      0,254,1,0,124,254,254,254,254,124,0,1,254,0,0,0,
    164.      0,0,0,128,128,64,64,64,64,128,128,0,0,0,0,0,
    165.      0,0,0,0,0,0,0,255,192,192,192,192,192,192,192,192,
    166.      0,0,108,56,0,56,108,198,198,254,198,198,198,0,0,0,
    167.      0,16,56,108,0,56,108,198,198,254,198,198,198,0,0,0,
    168.      0,16,56,68,254,102,98,104,120,104,98,102,254,0,0,0,
    169.      0,16,56,68,56,108,198,198,198,198,198,108,56,0,0,0,
    170.      0,0,3,1,58,108,198,198,198,198,198,108,56,0,0,0,
    171.      0,0,3,1,199,198,198,198,198,198,198,198,124,0,0,0,
    172.      0,0,0,0,248,108,102,102,254,102,102,108,248,0,0,0,
    173.      0,0,0,0,108,56,0,120,12,124,204,204,118,0,0,0,
    174.      0,0,0,0,56,108,0,120,12,124,204,204,118,0,0,0,
    175.      0,0,0,0,56,108,0,124,198,254,192,198,124,0,0,0,
    176.      0,0,0,0,56,108,0,124,198,198,198,198,124,0,0,0,
    177.      0,0,0,0,0,3,1,126,198,198,198,198,124,0,0,0,
    178.      0,0,0,0,0,3,1,206,204,204,204,204,118,0,0,0,
    179.      0,0,0,0,12,62,12,60,108,204,204,204,118,0,0,0,
    180.      0,224,96,112,112,112,112,112,112,112,112,112,240,240,0,0,
    181.      0,255,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
    182.      0,255,192,192,195,194,223,194,195,192,192,192,255,63,0,0,
    183.      0,255,192,192,192,192,192,192,192,192,192,192,255,63,0,0,
    184.      24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
    185.      255,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
    186.      0,0,192,96,48,0,0,120,12,124,204,204,118,0,0,0,
    187.      0,0,56,8,16,0,0,120,12,124,204,204,118,0,0,0,
    188.      0,0,0,118,220,0,0,120,12,124,204,204,118,0,0,0,
    189.      0,0,6,12,24,0,0,120,12,124,204,204,118,0,0,0,
    190.      0,0,0,0,0,0,0,120,12,124,204,204,118,0,48,48,
    191.      54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
    192.      0,0,96,16,76,56,0,120,12,124,204,204,118,0,0,0,
    193.      0,0,7,1,110,56,0,120,12,124,204,204,118,0,0,0,
    194.      0,0,118,220,108,56,0,120,12,124,204,204,118,0,0,0,
    195.      0,0,12,16,108,56,0,120,12,124,204,204,118,0,0,0,
    196.      0,0,0,0,0,0,0,248,24,24,24,24,24,24,24,24,
    197.      255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    198.      1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,
    199.      255,255,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
    200.      0,7,6,6,6,6,6,6,6,6,6,6,7,1,0,0,
    201.      0,255,0,6,6,12,12,152,216,240,112,0,255,255,0,0,
    202.      192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,255,
    203.      0,0,0,0,108,56,0,120,12,124,204,204,118,0,48,48,
    204.      0,0,192,96,56,108,0,120,12,124,204,204,118,0,0,0,
    205.      0,0,7,1,58,108,0,120,12,124,204,204,118,0,0,0,
    206.      0,0,118,220,56,108,0,120,12,124,204,204,118,0,0,0,
    207.      0,0,6,12,56,108,0,120,12,124,204,204,118,0,0,0,
    208.      0,0,0,0,56,108,0,120,12,124,204,204,118,0,48,48,
    209.      0,0,192,96,48,0,0,124,198,254,192,198,124,0,0,0,
    210.      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
    211.      0,0,56,8,16,0,0,124,198,254,192,198,124,0,0,0,
    212.      0,0,0,118,220,0,0,124,198,254,192,198,124,0,0,0,
    213.      0,0,6,12,24,0,0,124,198,254,192,198,124,0,0,0,
    214.      0,0,0,0,0,0,0,124,198,254,192,198,124,0,24,24,
    215.      0,48,24,12,56,108,0,124,198,254,192,198,124,0,0,0,
    216.      0,0,7,1,58,108,0,124,198,254,192,198,124,0,0,0,
    217.      0,0,118,220,56,108,0,124,198,254,192,198,124,0,0,0,
    218.      0,0,6,12,56,108,0,124,198,254,192,198,124,0,0,0,
    219.      0,0,0,0,56,108,0,124,198,254,192,198,124,0,24,24,
    220.      0,0,192,96,48,0,0,56,24,24,24,24,60,0,0,0,
    221.      0,0,56,8,16,0,0,56,24,24,24,24,60,0,0,0,
    222.      1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
    223.      255,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
    224.      255,128,128,128,128,128,128,159,159,128,128,128,128,128,128,255,
    225.      0,0,0,118,220,0,0,56,24,24,24,24,60,0,0,0,
    226.      0,0,6,12,24,0,0,56,24,24,24,24,60,0,0,0,
    227.      0,0,0,0,24,24,0,56,24,24,24,24,60,0,24,24,
    228.      0,0,192,96,48,0,0,124,198,198,198,198,124,0,0,0,
    229.      0,0,0,0,62,96,192,192,254,192,192,96,62,0,0,0,
    230.      0,0,56,8,16,0,0,124,198,198,198,198,124,0,0,0,
    231.      0,0,118,220,0,0,0,124,198,198,198,198,124,0,0,0,
    232.      0,0,6,12,24,0,0,124,198,198,198,198,124,0,0,0,
    233.      0,0,0,0,0,0,0,124,198,198,198,198,124,0,24,24,
    234.      0,0,192,96,56,108,0,124,198,198,198,198,124,0,0,0,
    235.      0,0,7,1,58,108,0,124,198,198,198,198,124,0,0,0,
    236.      0,0,118,220,56,108,0,124,198,198,198,198,124,0,0,0,
    237.      0,0,6,12,56,108,0,124,198,198,198,198,124,0,0,0,
    238.      0,0,0,0,56,108,0,124,198,198,198,198,124,0,24,24,
    239.      0,0,192,96,48,3,1,126,198,198,198,198,124,0,0,0,
    240.      0,0,56,8,16,3,1,126,198,198,198,198,124,0,0,0,
    241.      0,0,118,220,0,3,1,126,198,198,198,198,124,0,0,0,
    242.      0,0,6,12,24,3,1,126,198,198,198,198,124,0,0,0,
    243.      0,0,0,0,0,3,1,126,198,198,198,198,124,0,24,24,
    244.      0,0,192,96,48,0,0,204,204,204,204,204,118,0,0,0,
    245.      0,0,0,0,0,254,0,0,254,0,0,254,0,0,0,0,
    246.      0,0,56,8,16,0,0,204,204,204,204,204,118,0,0,0,
    247.      0,0,118,220,0,0,0,204,204,204,204,204,118,0,0,0,
    248.      0,0,6,12,24,0,0,204,204,204,204,204,118,0,0,0,
    249.      0,0,0,0,0,0,0,204,204,204,204,204,118,0,48,48,
    250.      0,0,192,96,48,3,1,206,204,204,204,204,118,0,0,0,
    251.      0,0,56,8,16,3,1,206,204,204,204,204,118,0,0,0,
    252.      0,0,118,220,0,3,1,206,204,204,204,204,118,0,0,0,
    253.      0,0,6,12,24,3,1,206,204,204,204,204,118,0,0,0,
    254.      0,0,0,0,0,3,1,206,204,204,204,204,118,0,48,48,
    255.      0,0,192,96,48,0,0,198,198,198,198,126,6,12,248,0,
    256.      0,0,56,8,16,0,0,198,198,198,198,126,6,12,248,0,
    257.      0,0,0,118,220,0,0,198,198,198,198,126,6,12,248,0,
    258.      0,0,6,12,24,0,0,198,198,198,198,126,6,12,248,0,
    259.      0,0,0,0,0,0,0,198,198,198,198,126,4,12,251,3,
    260.      0,254,1,0,0,0,0,0,0,0,0,1,254,0,0,0
    261.  };
    262.      textmode(C80);
    263.      asm{
    264.          cli
    265.          mov dx,0x3c4
    266.          mov ax,0x100
    267.          out dx,ax
    268.          mov ax,0x402
    269.          out dx,ax
    270.          mov ax,0x704
    271.          out dx,ax
    272.          mov ax,0x300
    273.          out dx,ax
    274.  
    275.          mov dx,0x3ce
    276.          mov ax,0x204
    277.          out dx,ax
    278.          mov ax,0x5
    279.          out dx,ax
    280.          mov ax,0x406
    281.          out dx,ax
    282.          }
    283.  
    284.         for(i=0;i<256;++i)
    285.          for(j=0;j<16;++j)
    286.              pokeb(0xa000, i*32+j, vnfont[i*16+j]);
    287.  
    288.  
    289.      asm{
    290.          mov dx,0x3c4
    291.          mov ax,0x100
    292.          out dx,ax
    293.          mov ax,0x302
    294.          out dx,ax
    295.          mov ax,0x304
    296.          out dx,ax
    297.          mov ax,0x300
    298.          out dx,ax
    299.  
    300.          mov dx,0x3ce
    301.          mov ax,0x4
    302.          out dx,ax
    303.          mov ax,0x1005
    304.          out dx,ax
    305.          mov ax,0xe06
    306.          out dx,ax
    307.          cli
    308.          }
    309.  
    310.      }
    Cách sử dụng :
    + copy hàm này vào bài của bạn
    + dùng notepad ( vào format chọn font chọn font .vntime ) + unikey or vietkey ( chế độ gõ TCVN3) để viết tiếng việt có dấu

    dùng hàm tiengviet(); đầu tiên trong hàm main như clrscr();

    và khi thoát thêm hàm này vào sau getch() để thoát khỏi chế độ tiếng việt
    C Code:
    1. void thoatf(void)  //giup cho thoat khoi che do tieng viet ma ko co bug
    2. {
    3.         textmode(C40);
    4.         exit(0);
    5. }
    ^_,^

    Facebook : https://www.facebook.com/langmaninternet

    Bùi Tấn Quang

  2. #2
    Ngày gia nhập
    06 2007
    Nơi ở
    C:\WINDOWS\system32\dllcache\
    Bài viết
    3,007

    2. cách gõ tiếng việt :

    nhập vào chuỗi
    void nhaptv(char *xau);
    mỗi lần nhập vào là 1 sự kiện và phân tích sự kiện đó ra:
    + enter kết thúc chuỗi
    + a ,d, o , e, w là các sự kiện quy định sẽ làm việc với kí tự trước đó. nếu kí tự trước đó cần biến hình thì mình thay đổi nó đi. nếu ko thì thêm kí tự vào chuỗi đã có
    +nếu là s z j x ... thì mình thay đổi trạng thái của nguyên âm gần nhất
    + nếu là xóa thì : giảm kí tự của chuỗi đi 1, check chuỗi để lấy lại vị trí của con trỏ nguyên âm gần nhất
    +nếu mà ko phải các trường hợp trên thì thêm vào chuỗi
    full code :
    C Code:
    1.     int phuam(char ch)
    2.     {
    3.         if (isalpha(ch)&&ch!='A'&&ch!='a'&&ch!='E'&&ch!='e'&&ch!='I'&&ch!='i'&&ch!='O'&&ch!='o'&&ch!='U'&&ch!='u'&&ch!='Y'&&ch!='y')
    4.             return 1;
    5.         else return 0;
    6.     }
    7.  
    8.     int tdsac(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    9.     {
    10.         switch(ch)
    11.             {
    12.                 case 'a':case 'µ':case '¶':case '¹':case '·':ch='¸';break;
    13.                 case '¨':case '»':case '¼':case 'Æ':case '½':ch='¾';break;
    14.                 case '©':case 'Ç':case 'È':case 'Ë':case 'É':ch='Ê';break;
    15.                 case 'e':case 'Ì':case 'Î':case 'Ñ':case 'Ï':ch='Ð';break;
    16.                 case 'ª':case 'Ò':case 'Ó':case 'Ö':case 'Ô':ch='Õ';break;
    17.                 case 'i':case '×':case 'Ø':case 'Þ':case 'Ü':ch='Ý';break;
    18.                 case 'y':case 'ú':case 'û':case 'þ':case 'ü':ch='ý';break;
    19.                 case 'u':case 'ï':case 'ñ':case 'ô':case 'ò':ch='ó';break;
    20.                 case '­':case 'õ':case 'ö':case 'ù':case '÷':ch='ø';break;
    21.                 case 'o':case 'ß':case 'á':case 'ä':case 'â':ch='ã';break;
    22.                 case '«':case 'å':case 'æ':case 'é':case 'ç':ch='è';break;
    23.                 case '¬':case 'ê':case 'ë':case 'î':case 'ì':ch='í';break;
    24.                 default : return 1;
    25.             }
    26.         return 0;
    27.     }
    28.  
    29.     int tdhuyen(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    30.     {
    31.         switch(ch)
    32.             {
    33.                 case 'a':case '¸':case '¶':case '¹':case '·':ch='µ';break;
    34.                 case '¨':case '¾':case '¼':case 'Æ':case '½':ch='»';break;
    35.                 case '©':case 'Ê':case 'È':case 'Ë':case 'É':ch='Ç';break;
    36.                 case 'e':case 'Ð':case 'Î':case 'Ñ':case 'Ï':ch='Ì';break;
    37.                 case 'ª':case 'Õ':case 'Ó':case 'Ö':case 'Ô':ch='Ò';break;
    38.                 case 'i':case 'Ý':case 'Ø':case 'Þ':case 'Ü':ch='×';break;
    39.                 case 'y':case 'ý':case 'û':case 'þ':case 'ü':ch='ú';break;
    40.                 case 'u':case 'ó':case 'ñ':case 'ô':case 'ò':ch='ï';break;
    41.                 case '­':case 'ø':case 'ö':case 'ù':case '÷':ch='õ';break;
    42.                 case 'o':case 'ã':case 'á':case 'ä':case 'â':ch='ß';break;
    43.                 case '«':case 'è':case 'æ':case 'é':case 'ç':ch='å';break;
    44.                 case '¬':case 'í':case 'ë':case 'î':case 'ì':ch='ê';break;
    45.                 default : return 1;
    46.             }
    47.         return 0;
    48.     }
    49.  
    50.     int tdhoi(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    51.     {
    52.         switch(ch)
    53.             {
    54.                 case 'a':case '¸':case 'µ':case '¹':case '·':ch='¶';break;
    55.                 case '¨':case '¾':case 'Ç':case 'Æ':case '½':ch='¼';break;
    56.                 case '©':case 'Ê':case '»':case 'Ë':case 'É':ch='È';break;
    57.                 case 'e':case 'Ð':case 'Ì':case 'Ñ':case 'Ï':ch='Î';break;
    58.                 case 'ª':case 'Õ':case 'Ò':case 'Ö':case 'Ô':ch='Ó';break;
    59.                 case 'i':case 'Ý':case '×':case 'Þ':case 'Ü':ch='Ø';break;
    60.                 case 'y':case 'ý':case 'ú':case 'þ':case 'ü':ch='û';break;
    61.                 case 'u':case 'ó':case 'ï':case 'ô':case 'ò':ch='ñ';break;
    62.                 case '­':case 'ø':case 'õ':case 'ù':case '÷':ch='ö';break;
    63.                 case 'o':case 'ã':case 'ß':case 'ä':case 'â':ch='á';break;
    64.                 case '«':case 'è':case 'å':case 'é':case 'ç':ch='æ';break;
    65.                 case '¬':case 'í':case 'ê':case 'î':case 'ì':ch='ë';break;
    66.                 default : return 1;
    67.             }
    68.         return 0;
    69.     }
    70.  
    71.     int tdnang(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    72.     {
    73.         switch(ch)
    74.             {
    75.                 case 'a':case '¸':case 'µ':case '¶':case '·':ch='¹';break;
    76.                 case '¨':case '¾':case 'Ç':case '¼':case '½':ch='Æ';break;
    77.                 case '©':case 'Ê':case '»':case 'È':case 'É':ch='Ë';break;
    78.                 case 'e':case 'Ð':case 'Ì':case 'Î':case 'Ï':ch='Ñ';break;
    79.                 case 'ª':case 'Õ':case 'Ò':case 'Ó':case 'Ô':ch='Ö';break;
    80.                 case 'i':case 'Ý':case '×':case 'Ø':case 'Ü':ch='Þ';break;
    81.                 case 'y':case 'ý':case 'ú':case 'û':case 'ü':ch='þ';break;
    82.                 case 'u':case 'ó':case 'ï':case 'ñ':case 'ò':ch='ô';break;
    83.                 case '­':case 'ø':case 'õ':case 'ö':case '÷':ch='ù';break;
    84.                 case 'o':case 'ã':case 'ß':case 'á':case 'â':ch='ä';break;
    85.                 case '«':case 'è':case 'å':case 'æ':case 'ç':ch='é';break;
    86.                 case '¬':case 'í':case 'ê':case 'ë':case 'ì':ch='î';break;
    87.                 default : return 1;
    88.             }
    89.         return 0;
    90.     }
    91.  
    92.     int tdnga(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    93.     {
    94.         switch(ch)
    95.             {
    96.                 case 'a':case '¸':case 'µ':case '¶':case '¹':ch='·';break;
    97.                 case '¨':case '¾':case 'Ç':case '¼':case 'Æ':ch='½';break;
    98.                 case '©':case 'Ê':case '»':case 'È':case 'Ë':ch='É';break;
    99.                 case 'e':case 'Ð':case 'Ì':case 'Î':case 'Ñ':ch='Ï';break;
    100.                 case 'ª':case 'Õ':case 'Ò':case 'Ó':case 'Ö':ch='Ô';break;
    101.                 case 'i':case 'Ý':case '×':case 'Ø':case 'Þ':ch='Ü';break;
    102.                 case 'y':case 'ý':case 'ú':case 'û':case 'þ':ch='ü';break;
    103.                 case 'u':case 'ó':case 'ï':case 'ñ':case 'ô':ch='ò';break;
    104.                 case '­':case 'ø':case 'õ':case 'ö':case 'ù':ch='÷';break;
    105.                 case 'o':case 'ã':case 'ß':case 'á':case 'ä':ch='â';break;
    106.                 case '«':case 'è':case 'å':case 'æ':case 'é':ch='ç';break;
    107.                 case '¬':case 'í':case 'ê':case 'ë':case 'î':ch='ì';break;
    108.                 default : return 1;
    109.             }
    110.         return 0;
    111.     }
    112.  
    113.     int tdkhong(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    114.     {
    115.         switch(ch)
    116.             {
    117.                 case '·':case '¸':case 'µ':case '¶':case '¹':ch='a';break;
    118.                 case '½':case '¾':case 'Ç':case '¼':case 'Æ':ch='¨';break;
    119.                 case 'É':case 'Ê':case '»':case 'È':case 'Ë':ch='©';break;
    120.                 case 'Ï':case 'Ð':case 'Ì':case 'Î':case 'Ñ':ch='e';break;
    121.                 case 'Ô':case 'Õ':case 'Ò':case 'Ó':case 'Ö':ch='ª';break;
    122.                 case 'Ü':case 'Ý':case '×':case 'Ø':case 'Þ':ch='i';break;
    123.                 case 'ü':case 'ý':case 'ú':case 'û':case 'þ':ch='y';break;
    124.                 case 'ò':case 'ó':case 'ï':case 'ñ':case 'ô':ch='u';break;
    125.                 case '÷':case 'ø':case 'õ':case 'ö':case 'ù':ch='­';break;
    126.                 case 'â':case 'ã':case 'ß':case 'á':case 'ä':ch='o';break;
    127.                 case 'ç':case 'è':case 'å':case 'æ':case 'é':ch='«';break;
    128.                 case 'ì':case 'í':case 'ê':case 'ë':case 'î':ch='¬';break;
    129.                 default : return 1;
    130.             }
    131.         return 0;
    132.     }
    133.  
    134.  
    135.     void nhaptv(char *xau)
    136.     {
    137.         int max=29;
    138.         char ch='a';
    139.         int i=0;
    140.         int flag,flagch=-1;
    141.         int x=wherex(),y=wherey();
    142.         _setcursortype(_NORMALCURSOR);
    143.         while (ch!=0xD)
    144.            {
    145.             ch=getch();
    146.             if(ch==0) {getch();continue;}
    147.             if (ch==0xD) continue;
    148.             if (i>0&&ch==0x20&&xau[i-1]==0x20) continue; //bai binh thuong xoa dong nay
    149.             if (!(isalpha(ch)||isdigit(ch)||ch==0x20||ch==0x8)) continue;
    150.             if (i==0||xau[i-1]==0x20) ch=toupper(ch);
    151.                 else ch=tolower(ch);
    152.             flag=0;
    153.             if (ch==0x20) flagch=-1;
    154.             if (ch==8)
    155.                 {
    156.                     if (i>0) {printf("\b ");xau[--i]=NULL;}
    157.                 }
    158.             else switch(tolower(ch))
    159.                 {
    160.                     case 'a': switch(xau[i-1])
    161.                             {
    162.                                 case 'a' :  xau[i-1]='©'; break;
    163.                                 case 'A' :  xau[i-1]='¢'; break;
    164.                                 default  :  flag=1;break;
    165.                             };
    166.                           break;
    167.                     case 'd': switch(xau[i-1])
    168.                             {
    169.                                 case 'd' :  xau[i-1]='®'; break;
    170.                                 case 'D' :  xau[i-1]='§'; break;
    171.                                 default  :  flag=1;break;
    172.                             }
    173.                           break;
    174.                     case 'e': switch(xau[i-1])
    175.                             {
    176.                                 case 'e' :  xau[i-1]='ª'; break;
    177.                                 case 'E' :  xau[i-1]='£'; break;
    178.                                 default  :  flag=1;break;
    179.                             }
    180.                           break;
    181.                     case 'o': switch(xau[i-1])
    182.                             {
    183.                                 case 'o' :  xau[i-1]='«'; break;
    184.                                 case 'O' :  xau[i-1]='¤'; break;
    185.                                 default  :  flag=1;break;
    186.                             }
    187.                           break;
    188.                     case 'w': switch(xau[i-1])
    189.                             {
    190.                                 case 'o' :  xau[i-1]='¬'; break;
    191.                                 case 'O' :  xau[i-1]='¥'; break;
    192.                                 case 'u' :  xau[i-1]='­'; break;
    193.                                 case 'U' :  xau[i-1]='¦'; break;
    194.                                 case 'a' :  xau[i-1]='¨'; break;
    195.                                 case 'A' :  xau[i-1]='¡'; break;
    196.                                 default  :  flag=1;break;
    197.                             }
    198.                           break;
    199.                     case 's': if (flagch!=-1) flag=tdsac(xau[flagch]);
    200.                           else flag=1;
    201.                           break;
    202.                     case 'f': if (flagch!=-1) flag=tdhuyen(xau[flagch]);
    203.                           else flag=1;
    204.                           break;
    205.                     case 'r': if (flagch!=-1) flag=tdhoi(xau[flagch]);
    206.                           else flag=1;
    207.                           break;
    208.                     case 'x': if (flagch!=-1) flag=tdnga(xau[flagch]);
    209.                           else flag=1;
    210.                           break;
    211.                     case 'j': if (flagch!=-1) flag=tdnang(xau[flagch]);
    212.                           else flag=1;
    213.                           break;
    214.                     case 'z': if (flagch!=-1) flag=tdkhong(xau[flagch]);
    215.                           else flag=1;
    216.                           break;
    217.                     default : flag=1;break;
    218.                 }
    219.             if (flag) {xau[i++]=ch;xau[i]=NULL;}
    220.             if (i>1&&((xau[i-1]=='i'||xau[i-1]=='u'||xau[i-1]=='o')&&phuam(xau[i-2]))||(!phuam(xau[i-1])&&xau[i-1]!='i'&&xau[i-1]!='u'&&xau[i-1]!='o'))
    221.                 flagch=i-1;
    222.  
    223.             gotoxy(x,y);cprintf("%s",xau);
    224.  
    225.             if (i==max) break;
    226.            }
    227.         if (i==0) xau[i]=NULL;
    228.         _setcursortype(_NOCURSOR);
    229.         printf("\n");
    230.     }
    Đã được chỉnh sửa lần cuối bởi langman : 05-03-2010 lúc 06:35 PM.
    ^_,^

    Facebook : https://www.facebook.com/langmaninternet

    Bùi Tấn Quang

  3. #3
    Ngày gia nhập
    06 2007
    Nơi ở
    C:\WINDOWS\system32\dllcache\
    Bài viết
    3,007

    Chương trình demo ở đính kèm đây!

    3. tiếng việt trong chế độ đồ họa.
    C Code:
    1.     void xvm(unsigned char*,int,int,int=WHITE);       //xeng viet mang
    2.     void xvm(unsigned char*a,int x,int y,int c) //xeng viet mang 16 int
    3.     {
    4.         int i,j;
    5.         for(i=0;i<16;i++)
    6.             {
    7.             for(j=0;j<8;j++)
    8.                {
    9.                 if(a[i]&1)putpixel(x+8-j,y,c);
    10.                 a[i]>>=1;
    11.                }
    12.             y++;
    13.             }
    14.     }
    15.  
    16.  
    17.     //viết xâu lên màn hình tại vị trí x,y
    18.     void viet(unsigned char *xau,int x,int y,int c=WHITE)
    19.     {
    20.         int temp=strlen(xau);
    21.         unsigned char a[16];
    22.         FILE *p=fopen("quang.x","rb");
    23.         for(int i=0;i<temp;i++)
    24.             {
    25.                 fseek(p,((unsigned char)xau[i])*16,SEEK_SET);
    26.                 fread(a,sizeof(char),16,p);
    27.                 xvm(a,x,y,c);
    28.                 x+=10;
    29.             }
    30.         fclose(p);
    31.     }

    file quang.x được đính kém dưới đây, download về giải nén và copy vào thư mục BIN của TC hoặc BC. File này chính là file rút gọn từ file font .vntime
    bạn có thể sử dụng file font này thay cho file quang.x cũng được




    Demo tiengviet.c
    C Code:
    1. #include <stdio.h>
    2. #include <dos.h>
    3. #include <ctype.h>
    4. #include <conio.h>
    5. #include <process.h>
    6.  
    7. //******************************BEGIN***************************************\
    8. //cac thao tac khoi tao tieng viet va giup nhap tieng viet
    9. void tiengviet(void)
    10. {
    11.      int    i, j;
    12.      char    vnfont[16*256]={
    13.      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    14.      24,24,24,24,24,24,24,248,0,0,0,0,0,0,0,0,
    15.      240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
    16.      255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,
    17.      0,254,2,3,63,3,3,3,3,3,3,3,255,255,0,0,
    18.      0,254,254,254,254,126,62,30,14,6,254,254,254,254,254,0,
    19.      255,1,1,1,1,1,1,249,249,1,1,1,1,1,1,255,
    20.      0,0,0,0,0,0,24,60,60,24,0,0,0,0,0,0,
    21.      0,255,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
    22.      0,254,254,126,62,30,14,6,126,126,126,126,126,254,254,0,
    23.      0,254,254,126,126,126,126,126,6,14,30,62,126,254,254,0,
    24.      0,0,248,4,254,2,3,3,3,3,3,3,255,255,0,0,
    25.      255,128,129,131,135,143,159,191,131,131,131,131,131,128,128,255,
    26.      0,254,2,3,3,255,3,3,3,3,3,3,255,255,0,0,
    27.      0,254,2,115,131,131,131,115,3,3,3,3,255,255,0,0,
    28.      0,254,2,3,195,67,251,67,195,3,3,3,255,255,0,0,
    29.      0,0,64,96,112,120,124,126,124,120,112,96,64,0,0,0,
    30.      0,0,1,3,7,15,31,63,31,15,7,3,1,0,0,0,
    31.      0,254,2,243,139,243,147,139,3,3,3,3,255,255,0,0,
    32.      0,254,2,251,131,243,131,251,3,3,3,3,255,255,0,0,
    33.      255,1,125,125,171,215,239,239,239,215,187,109,85,41,1,255,
    34.      0,254,130,130,130,84,40,16,16,40,68,130,170,214,254,0,
    35.      0,0,0,0,0,0,0,255,24,24,24,24,24,24,24,24,
    36.      0,1,3,2,6,4,12,136,216,80,112,32,0,0,0,0,
    37.      0,0,0,0,8,28,62,127,28,28,28,28,0,0,0,0,
    38.      0,0,0,0,28,28,28,28,127,62,28,8,0,0,0,0,
    39.      0,0,0,0,0,0,24,12,254,12,24,0,0,0,0,0,
    40.      0,0,0,0,0,0,48,96,254,96,48,0,0,0,0,0,
    41.      0,127,126,124,127,111,79,0,0,79,111,127,124,126,127,0,
    42.      0,126,62,30,126,118,114,0,0,114,118,126,30,62,126,0,
    43.      0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
    44.      255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
    45.      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    46.      0,0,0,0,24,60,60,60,24,24,0,24,24,0,0,0,
    47.      0,0,0,102,102,102,36,0,0,0,0,0,0,0,0,0,
    48.      0,0,0,0,108,108,254,108,108,108,254,108,108,0,0,0,
    49.      0,0,24,24,124,198,194,192,124,6,134,198,124,24,24,0,
    50.      0,0,0,0,0,0,194,198,12,24,48,102,198,0,0,0,
    51.      0,0,0,0,56,108,108,56,118,220,204,204,118,0,0,0,
    52.      0,0,0,48,48,48,96,0,0,0,0,0,0,0,0,0,
    53.      0,0,0,0,12,24,48,48,48,48,48,24,12,0,0,0,
    54.      0,0,0,0,48,24,12,12,12,12,12,24,48,0,0,0,
    55.      0,0,0,0,0,0,102,60,255,60,102,0,0,0,0,0,
    56.      0,0,0,0,0,0,24,24,126,24,24,0,0,0,0,0,
    57.      0,0,0,0,0,0,0,0,0,0,24,24,24,48,0,0,
    58.      0,0,0,0,0,0,0,0,254,0,0,0,0,0,0,0,
    59.      0,0,0,0,0,0,0,0,0,0,0,24,24,0,0,0,
    60.      0,0,0,0,2,6,12,24,48,96,192,128,0,0,0,0,
    61.      0,0,0,0,124,198,206,222,246,230,198,198,124,0,0,0,
    62.      0,0,0,0,24,56,120,24,24,24,24,24,126,0,0,0,
    63.      0,0,0,0,124,198,6,12,24,48,96,198,254,0,0,0,
    64.      0,0,0,0,124,198,6,6,60,6,6,198,124,0,0,0,
    65.      0,0,0,0,12,28,60,108,204,254,12,12,30,0,0,0,
    66.      0,0,0,0,254,192,192,192,252,6,6,198,124,0,0,0,
    67.      0,0,0,0,60,96,192,192,252,198,198,198,124,0,0,0,
    68.      0,0,0,0,254,198,6,12,24,48,48,48,48,0,0,0,
    69.      0,0,0,0,124,198,198,198,124,198,198,198,124,0,0,0,
    70.      0,0,0,0,124,198,198,198,126,6,6,12,120,0,0,0,
    71.      0,0,0,0,0,24,24,0,0,0,24,24,0,0,0,0,
    72.      0,0,0,0,0,24,24,0,0,0,24,24,48,0,0,0,
    73.      0,0,0,0,6,12,24,48,96,48,24,12,6,0,0,0,
    74.      0,0,0,0,0,0,0,126,0,0,126,0,0,0,0,0,
    75.      0,0,0,0,96,48,24,12,6,12,24,48,96,0,0,0,
    76.      0,0,0,0,124,198,198,12,24,24,0,24,24,0,0,0,
    77.      0,0,0,0,124,198,198,222,222,222,220,192,124,0,0,0,
    78.      0,0,0,0,16,56,108,198,198,254,198,198,198,0,0,0,
    79.      0,0,0,0,252,102,102,102,124,102,102,102,252,0,0,0,
    80.      0,0,0,0,60,102,194,192,192,192,194,102,60,0,0,0,
    81.      0,0,0,0,248,108,102,102,102,102,102,108,248,0,0,0,
    82.      0,0,0,0,254,102,98,104,120,104,98,102,254,0,0,0,
    83.      0,0,0,0,254,102,98,104,120,104,96,96,240,0,0,0,
    84.      0,0,0,0,60,102,194,192,192,222,198,102,58,0,0,0,
    85.      0,0,0,0,198,198,198,198,254,198,198,198,198,0,0,0,
    86.      0,0,0,0,60,24,24,24,24,24,24,24,60,0,0,0,
    87.      0,0,0,0,30,12,12,12,12,12,204,204,120,0,0,0,
    88.      0,0,0,0,230,102,108,108,120,108,108,102,230,0,0,0,
    89.      0,0,0,0,240,96,96,96,96,96,98,102,254,0,0,0,
    90.      0,0,0,0,198,238,254,254,214,198,198,198,198,0,0,0,
    91.      0,0,0,0,198,230,246,254,222,206,198,198,198,0,0,0,
    92.      0,0,0,0,56,108,198,198,198,198,198,108,56,0,0,0,
    93.      0,0,0,0,252,102,102,102,124,96,96,96,240,0,0,0,
    94.      0,0,0,0,124,198,198,198,198,214,222,124,12,14,0,0,
    95.      0,0,0,0,252,102,102,102,124,108,102,102,231,0,0,0,
    96.      0,0,0,0,124,198,198,96,56,12,198,198,124,0,0,0,
    97.      0,0,0,0,126,126,90,24,24,24,24,24,60,0,0,0,
    98.      0,0,0,0,198,198,198,198,198,198,198,198,124,0,0,0,
    99.      0,0,0,0,198,198,198,198,198,198,108,56,16,0,0,0,
    100.      0,0,0,0,198,198,198,198,214,214,254,124,108,0,0,0,
    101.      0,0,0,0,198,198,108,56,56,56,108,198,198,0,0,0,
    102.      0,0,0,0,102,102,102,102,60,24,24,24,60,0,0,0,
    103.      0,0,0,0,254,198,140,24,48,96,194,198,254,0,0,0,
    104.      0,0,0,0,60,48,48,48,48,48,48,48,60,0,0,0,
    105.      0,0,0,0,128,192,224,112,56,28,14,6,2,0,0,0,
    106.      0,0,0,0,60,12,12,12,12,12,12,12,60,0,0,0,
    107.      0,0,16,56,108,198,0,0,0,0,0,0,0,0,0,0,
    108.      0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,
    109.      0,0,48,48,24,0,0,0,0,0,0,0,0,0,0,0,
    110.      0,0,0,0,0,0,0,120,12,124,204,204,118,0,0,0,
    111.      0,0,0,0,224,96,96,120,108,102,102,102,124,0,0,0,
    112.      0,0,0,0,0,0,0,124,198,192,192,198,124,0,0,0,
    113.      0,0,0,0,28,12,12,60,108,204,204,204,118,0,0,0,
    114.      0,0,0,0,0,0,0,124,198,254,192,198,124,0,0,0,
    115.      0,0,0,0,56,108,100,96,240,96,96,96,240,0,0,0,
    116.      0,0,0,0,0,0,0,118,204,204,204,124,12,204,120,0,
    117.      0,0,0,0,224,96,96,108,118,102,102,102,230,0,0,0,
    118.      0,0,0,0,24,24,0,56,24,24,24,24,60,0,0,0,
    119.      0,0,0,0,6,6,0,14,6,6,6,6,102,102,60,0,
    120.      0,0,0,0,224,96,96,102,108,120,108,102,230,0,0,0,
    121.      0,0,0,0,56,24,24,24,24,24,24,24,60,0,0,0,
    122.      0,0,0,0,0,0,0,236,254,214,214,214,198,0,0,0,
    123.      0,0,0,0,0,0,0,220,102,102,102,102,102,0,0,0,
    124.      0,0,0,0,0,0,0,124,198,198,198,198,124,0,0,0,
    125.      0,0,0,0,0,0,0,220,102,102,102,124,96,96,240,0,
    126.      0,0,0,0,0,0,0,118,204,204,204,124,12,12,30,0,
    127.      0,0,0,0,0,0,0,220,118,102,96,96,240,0,0,0,
    128.      0,0,0,0,0,0,0,124,198,112,28,198,124,0,0,0,
    129.      0,0,0,0,16,48,48,252,48,48,48,54,28,0,0,0,
    130.      0,0,0,0,0,0,0,204,204,204,204,204,118,0,0,0,
    131.      0,0,0,0,0,0,0,102,102,102,102,60,24,0,0,0,
    132.      0,0,0,0,0,0,0,198,198,214,214,254,108,0,0,0,
    133.      0,0,0,0,0,0,0,198,108,56,56,108,198,0,0,0,
    134.      0,0,0,0,0,0,0,198,198,198,198,126,6,12,248,0,
    135.      0,0,0,0,0,0,0,254,204,24,48,102,254,0,0,0,
    136.      0,0,0,0,14,24,24,24,112,24,24,24,14,0,0,0,
    137.      0,0,0,0,24,24,24,24,0,24,24,24,24,0,0,0,
    138.      0,0,0,0,112,24,24,24,14,24,24,24,112,0,0,0,
    139.      0,0,0,0,118,220,0,0,0,0,0,0,0,0,0,0,
    140.      0,0,0,0,0,0,16,56,108,198,198,254,0,0,0,0,
    141.      0,0,0,0,0,0,124,198,192,192,198,124,24,12,248,0,
    142.      0,0,0,0,204,204,0,204,204,204,204,204,118,0,0,0,
    143.      0,0,0,0,108,108,0,120,12,124,204,204,118,0,0,0,
    144.      0,0,48,72,72,48,0,120,12,124,204,204,118,0,0,0,
    145.      0,0,0,0,108,108,0,124,198,254,192,198,124,0,0,0,
    146.      0,0,0,0,108,108,0,56,24,24,24,24,60,0,0,0,
    147.      0,0,0,24,60,102,0,56,24,24,24,24,60,0,0,0,
    148.      0,0,0,0,108,222,26,26,126,216,216,218,108,0,0,0,
    149.      0,0,0,0,204,204,0,124,198,198,198,198,124,0,0,0,
    150.      0,0,0,48,120,204,0,204,204,204,204,204,118,0,0,0,
    151.      0,0,0,0,198,198,0,198,198,198,198,126,6,12,120,0,
    152.      0,0,24,24,24,124,198,192,192,198,124,24,24,24,0,0,
    153.      0,0,0,56,108,100,96,240,96,96,102,230,188,0,0,0,
    154.      0,0,0,102,102,102,60,24,126,24,60,24,24,0,0,0,
    155.      0,0,0,252,102,102,124,98,102,111,102,102,243,0,0,0,
    156.      0,0,0,0,118,220,0,220,102,102,102,102,102,0,0,0,
    157.      0,0,0,0,0,0,54,108,216,108,54,0,0,0,0,0,
    158.      0,0,0,0,0,0,216,108,54,108,216,0,0,0,0,0,
    159.      0,0,0,0,24,24,24,126,24,24,24,0,126,126,0,0,
    160.      0,0,0,0,96,48,24,12,24,48,96,0,124,124,0,0,
    161.      0,0,0,0,12,24,48,96,48,24,12,0,124,124,0,0,
    162.      24,24,24,60,60,126,126,255,24,24,24,24,24,24,24,24,
    163.      24,24,24,24,24,24,24,24,255,126,126,60,60,24,24,24,
    164.      0,0,0,0,0,64,112,124,255,124,112,64,0,0,0,0,
    165.      0,0,0,0,0,2,14,62,255,62,14,2,0,0,0,0,
    166.      0,224,32,48,48,48,48,48,48,48,48,48,240,240,0,0,
    167.      255,128,128,128,128,128,128,159,159,128,128,128,128,128,128,255,
    168.      192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
    169.      255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    170.      0,240,24,28,30,30,3,3,3,3,3,3,255,255,0,0,
    171.      0,254,1,0,124,254,254,254,254,124,0,1,254,0,0,0,
    172.      0,0,0,128,128,64,64,64,64,128,128,0,0,0,0,0,
    173.      0,0,0,0,0,0,0,255,192,192,192,192,192,192,192,192,
    174.      0,0,108,56,0,56,108,198,198,254,198,198,198,0,0,0,
    175.      0,16,56,108,0,56,108,198,198,254,198,198,198,0,0,0,
    176.      0,16,56,68,254,102,98,104,120,104,98,102,254,0,0,0,
    177.      0,16,56,68,56,108,198,198,198,198,198,108,56,0,0,0,
    178.      0,0,3,1,58,108,198,198,198,198,198,108,56,0,0,0,
    179.      0,0,3,1,199,198,198,198,198,198,198,198,124,0,0,0,
    180.      0,0,0,0,248,108,102,102,254,102,102,108,248,0,0,0,
    181.      0,0,0,0,108,56,0,120,12,124,204,204,118,0,0,0,
    182.      0,0,0,0,56,108,0,120,12,124,204,204,118,0,0,0,
    183.      0,0,0,0,56,108,0,124,198,254,192,198,124,0,0,0,
    184.      0,0,0,0,56,108,0,124,198,198,198,198,124,0,0,0,
    185.      0,0,0,0,0,3,1,126,198,198,198,198,124,0,0,0,
    186.      0,0,0,0,0,3,1,206,204,204,204,204,118,0,0,0,
    187.      0,0,0,0,12,62,12,60,108,204,204,204,118,0,0,0,
    188.      0,224,96,112,112,112,112,112,112,112,112,112,240,240,0,0,
    189.      0,255,0,0,0,0,0,0,0,0,0,0,255,255,0,0,
    190.      0,255,192,192,195,194,223,194,195,192,192,192,255,63,0,0,
    191.      0,255,192,192,192,192,192,192,192,192,192,192,255,63,0,0,
    192.      24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,
    193.      255,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
    194.      0,0,192,96,48,0,0,120,12,124,204,204,118,0,0,0,
    195.      0,0,56,8,16,0,0,120,12,124,204,204,118,0,0,0,
    196.      0,0,0,118,220,0,0,120,12,124,204,204,118,0,0,0,
    197.      0,0,6,12,24,0,0,120,12,124,204,204,118,0,0,0,
    198.      0,0,0,0,0,0,0,120,12,124,204,204,118,0,48,48,
    199.      54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
    200.      0,0,96,16,76,56,0,120,12,124,204,204,118,0,0,0,
    201.      0,0,7,1,110,56,0,120,12,124,204,204,118,0,0,0,
    202.      0,0,118,220,108,56,0,120,12,124,204,204,118,0,0,0,
    203.      0,0,12,16,108,56,0,120,12,124,204,204,118,0,0,0,
    204.      0,0,0,0,0,0,0,248,24,24,24,24,24,24,24,24,
    205.      255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    206.      1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255,
    207.      255,255,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
    208.      0,7,6,6,6,6,6,6,6,6,6,6,7,1,0,0,
    209.      0,255,0,6,6,12,12,152,216,240,112,0,255,255,0,0,
    210.      192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,255,
    211.      0,0,0,0,108,56,0,120,12,124,204,204,118,0,48,48,
    212.      0,0,192,96,56,108,0,120,12,124,204,204,118,0,0,0,
    213.      0,0,7,1,58,108,0,120,12,124,204,204,118,0,0,0,
    214.      0,0,118,220,56,108,0,120,12,124,204,204,118,0,0,0,
    215.      0,0,6,12,56,108,0,120,12,124,204,204,118,0,0,0,
    216.      0,0,0,0,56,108,0,120,12,124,204,204,118,0,48,48,
    217.      0,0,192,96,48,0,0,124,198,254,192,198,124,0,0,0,
    218.      0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
    219.      0,0,56,8,16,0,0,124,198,254,192,198,124,0,0,0,
    220.      0,0,0,118,220,0,0,124,198,254,192,198,124,0,0,0,
    221.      0,0,6,12,24,0,0,124,198,254,192,198,124,0,0,0,
    222.      0,0,0,0,0,0,0,124,198,254,192,198,124,0,24,24,
    223.      0,48,24,12,56,108,0,124,198,254,192,198,124,0,0,0,
    224.      0,0,7,1,58,108,0,124,198,254,192,198,124,0,0,0,
    225.      0,0,118,220,56,108,0,124,198,254,192,198,124,0,0,0,
    226.      0,0,6,12,56,108,0,124,198,254,192,198,124,0,0,0,
    227.      0,0,0,0,56,108,0,124,198,254,192,198,124,0,24,24,
    228.      0,0,192,96,48,0,0,56,24,24,24,24,60,0,0,0,
    229.      0,0,56,8,16,0,0,56,24,24,24,24,60,0,0,0,
    230.      1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
    231.      255,255,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
    232.      255,128,128,128,128,128,128,159,159,128,128,128,128,128,128,255,
    233.      0,0,0,118,220,0,0,56,24,24,24,24,60,0,0,0,
    234.      0,0,6,12,24,0,0,56,24,24,24,24,60,0,0,0,
    235.      0,0,0,0,24,24,0,56,24,24,24,24,60,0,24,24,
    236.      0,0,192,96,48,0,0,124,198,198,198,198,124,0,0,0,
    237.      0,0,0,0,62,96,192,192,254,192,192,96,62,0,0,0,
    238.      0,0,56,8,16,0,0,124,198,198,198,198,124,0,0,0,
    239.      0,0,118,220,0,0,0,124,198,198,198,198,124,0,0,0,
    240.      0,0,6,12,24,0,0,124,198,198,198,198,124,0,0,0,
    241.      0,0,0,0,0,0,0,124,198,198,198,198,124,0,24,24,
    242.      0,0,192,96,56,108,0,124,198,198,198,198,124,0,0,0,
    243.      0,0,7,1,58,108,0,124,198,198,198,198,124,0,0,0,
    244.      0,0,118,220,56,108,0,124,198,198,198,198,124,0,0,0,
    245.      0,0,6,12,56,108,0,124,198,198,198,198,124,0,0,0,
    246.      0,0,0,0,56,108,0,124,198,198,198,198,124,0,24,24,
    247.      0,0,192,96,48,3,1,126,198,198,198,198,124,0,0,0,
    248.      0,0,56,8,16,3,1,126,198,198,198,198,124,0,0,0,
    249.      0,0,118,220,0,3,1,126,198,198,198,198,124,0,0,0,
    250.      0,0,6,12,24,3,1,126,198,198,198,198,124,0,0,0,
    251.      0,0,0,0,0,3,1,126,198,198,198,198,124,0,24,24,
    252.      0,0,192,96,48,0,0,204,204,204,204,204,118,0,0,0,
    253.      0,0,0,0,0,254,0,0,254,0,0,254,0,0,0,0,
    254.      0,0,56,8,16,0,0,204,204,204,204,204,118,0,0,0,
    255.      0,0,118,220,0,0,0,204,204,204,204,204,118,0,0,0,
    256.      0,0,6,12,24,0,0,204,204,204,204,204,118,0,0,0,
    257.      0,0,0,0,0,0,0,204,204,204,204,204,118,0,48,48,
    258.      0,0,192,96,48,3,1,206,204,204,204,204,118,0,0,0,
    259.      0,0,56,8,16,3,1,206,204,204,204,204,118,0,0,0,
    260.      0,0,118,220,0,3,1,206,204,204,204,204,118,0,0,0,
    261.      0,0,6,12,24,3,1,206,204,204,204,204,118,0,0,0,
    262.      0,0,0,0,0,3,1,206,204,204,204,204,118,0,48,48,
    263.      0,0,192,96,48,0,0,198,198,198,198,126,6,12,248,0,
    264.      0,0,56,8,16,0,0,198,198,198,198,126,6,12,248,0,
    265.      0,0,0,118,220,0,0,198,198,198,198,126,6,12,248,0,
    266.      0,0,6,12,24,0,0,198,198,198,198,126,6,12,248,0,
    267.      0,0,0,0,0,0,0,198,198,198,198,126,4,12,251,3,
    268.      0,254,1,0,0,0,0,0,0,0,0,1,254,0,0,0
    269.  };
    270.      textmode(C80);
    271.      asm{
    272.          cli
    273.          mov dx,0x3c4
    274.          mov ax,0x100
    275.          out dx,ax
    276.          mov ax,0x402
    277.          out dx,ax
    278.          mov ax,0x704
    279.          out dx,ax
    280.          mov ax,0x300
    281.          out dx,ax
    282.  
    283.          mov dx,0x3ce
    284.          mov ax,0x204
    285.          out dx,ax
    286.          mov ax,0x5
    287.          out dx,ax
    288.          mov ax,0x406
    289.          out dx,ax
    290.          }
    291.  
    292.         for(i=0;i<256;++i)
    293.          for(j=0;j<16;++j)
    294.              pokeb(0xa000, i*32+j, vnfont[i*16+j]);
    295.  
    296.  
    297.      asm{
    298.          mov dx,0x3c4
    299.          mov ax,0x100
    300.          out dx,ax
    301.          mov ax,0x302
    302.          out dx,ax
    303.          mov ax,0x304
    304.          out dx,ax
    305.          mov ax,0x300
    306.          out dx,ax
    307.  
    308.          mov dx,0x3ce
    309.          mov ax,0x4
    310.          out dx,ax
    311.          mov ax,0x1005
    312.          out dx,ax
    313.          mov ax,0xe06
    314.          out dx,ax
    315.          cli
    316.          }
    317.  
    318.      }
    319.     int phuam(char ch)
    320.     {
    321.         if (isalpha(ch)&&ch!='A'&&ch!='a'&&ch!='E'&&ch!='e'&&ch!='I'&&ch!='i'&&ch!='O'&&ch!='o'&&ch!='U'&&ch!='u'&&ch!='Y'&&ch!='y')
    322.             return 1;
    323.         else return 0;
    324.     }
    325.     int tdsac(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    326.     {
    327.         switch(ch)
    328.             {
    329.                 case 'a':case 'µ':case '¶':case '¹':case '·':ch='¸';break;
    330.                 case '¨':case '»':case '¼':case 'Æ':case '½':ch='¾';break;
    331.                 case '©':case 'Ç':case 'È':case 'Ë':case 'É':ch='Ê';break;
    332.                 case 'e':case 'Ì':case 'Î':case 'Ñ':case 'Ï':ch='Ð';break;
    333.                 case 'ª':case 'Ò':case 'Ó':case 'Ö':case 'Ô':ch='Õ';break;
    334.                 case 'i':case '×':case 'Ø':case 'Þ':case 'Ü':ch='Ý';break;
    335.                 case 'y':case 'ú':case 'û':case 'þ':case 'ü':ch='ý';break;
    336.                 case 'u':case 'ï':case 'ñ':case 'ô':case 'ò':ch='ó';break;
    337.                 case '­':case 'õ':case 'ö':case 'ù':case '÷':ch='ø';break;
    338.                 case 'o':case 'ß':case 'á':case 'ä':case 'â':ch='ã';break;
    339.                 case '«':case 'å':case 'æ':case 'é':case 'ç':ch='è';break;
    340.                 case '¬':case 'ê':case 'ë':case 'î':case 'ì':ch='í';break;
    341.                 default : return 1;
    342.             }
    343.         return 0;
    344.     }
    345.     int tdhuyen(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    346.     {
    347.         switch(ch)
    348.             {
    349.                 case 'a':case '¸':case '¶':case '¹':case '·':ch='µ';break;
    350.                 case '¨':case '¾':case '¼':case 'Æ':case '½':ch='»';break;
    351.                 case '©':case 'Ê':case 'È':case 'Ë':case 'É':ch='Ç';break;
    352.                 case 'e':case 'Ð':case 'Î':case 'Ñ':case 'Ï':ch='Ì';break;
    353.                 case 'ª':case 'Õ':case 'Ó':case 'Ö':case 'Ô':ch='Ò';break;
    354.                 case 'i':case 'Ý':case 'Ø':case 'Þ':case 'Ü':ch='×';break;
    355.                 case 'y':case 'ý':case 'û':case 'þ':case 'ü':ch='ú';break;
    356.                 case 'u':case 'ó':case 'ñ':case 'ô':case 'ò':ch='ï';break;
    357.                 case '­':case 'ø':case 'ö':case 'ù':case '÷':ch='õ';break;
    358.                 case 'o':case 'ã':case 'á':case 'ä':case 'â':ch='ß';break;
    359.                 case '«':case 'è':case 'æ':case 'é':case 'ç':ch='å';break;
    360.                 case '¬':case 'í':case 'ë':case 'î':case 'ì':ch='ê';break;
    361.                 default : return 1;
    362.             }
    363.         return 0;
    364.     }
    365.     int tdhoi(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    366.     {
    367.         switch(ch)
    368.             {
    369.                 case 'a':case '¸':case 'µ':case '¹':case '·':ch='¶';break;
    370.                 case '¨':case '¾':case 'Ç':case 'Æ':case '½':ch='¼';break;
    371.                 case '©':case 'Ê':case '»':case 'Ë':case 'É':ch='È';break;
    372.                 case 'e':case 'Ð':case 'Ì':case 'Ñ':case 'Ï':ch='Î';break;
    373.                 case 'ª':case 'Õ':case 'Ò':case 'Ö':case 'Ô':ch='Ó';break;
    374.                 case 'i':case 'Ý':case '×':case 'Þ':case 'Ü':ch='Ø';break;
    375.                 case 'y':case 'ý':case 'ú':case 'þ':case 'ü':ch='û';break;
    376.                 case 'u':case 'ó':case 'ï':case 'ô':case 'ò':ch='ñ';break;
    377.                 case '­':case 'ø':case 'õ':case 'ù':case '÷':ch='ö';break;
    378.                 case 'o':case 'ã':case 'ß':case 'ä':case 'â':ch='á';break;
    379.                 case '«':case 'è':case 'å':case 'é':case 'ç':ch='æ';break;
    380.                 case '¬':case 'í':case 'ê':case 'î':case 'ì':ch='ë';break;
    381.                 default : return 1;
    382.             }
    383.         return 0;
    384.     }
    385.     int tdnang(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    386.     {
    387.         switch(ch)
    388.             {
    389.                 case 'a':case '¸':case 'µ':case '¶':case '·':ch='¹';break;
    390.                 case '¨':case '¾':case 'Ç':case '¼':case '½':ch='Æ';break;
    391.                 case '©':case 'Ê':case '»':case 'È':case 'É':ch='Ë';break;
    392.                 case 'e':case 'Ð':case 'Ì':case 'Î':case 'Ï':ch='Ñ';break;
    393.                 case 'ª':case 'Õ':case 'Ò':case 'Ó':case 'Ô':ch='Ö';break;
    394.                 case 'i':case 'Ý':case '×':case 'Ø':case 'Ü':ch='Þ';break;
    395.                 case 'y':case 'ý':case 'ú':case 'û':case 'ü':ch='þ';break;
    396.                 case 'u':case 'ó':case 'ï':case 'ñ':case 'ò':ch='ô';break;
    397.                 case '­':case 'ø':case 'õ':case 'ö':case '÷':ch='ù';break;
    398.                 case 'o':case 'ã':case 'ß':case 'á':case 'â':ch='ä';break;
    399.                 case '«':case 'è':case 'å':case 'æ':case 'ç':ch='é';break;
    400.                 case '¬':case 'í':case 'ê':case 'ë':case 'ì':ch='î';break;
    401.                 default : return 1;
    402.             }
    403.         return 0;
    404.     }
    405.     int tdnga(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    406.     {
    407.         switch(ch)
    408.             {
    409.                 case 'a':case '¸':case 'µ':case '¶':case '¹':ch='·';break;
    410.                 case '¨':case '¾':case 'Ç':case '¼':case 'Æ':ch='½';break;
    411.                 case '©':case 'Ê':case '»':case 'È':case 'Ë':ch='É';break;
    412.                 case 'e':case 'Ð':case 'Ì':case 'Î':case 'Ñ':ch='Ï';break;
    413.                 case 'ª':case 'Õ':case 'Ò':case 'Ó':case 'Ö':ch='Ô';break;
    414.                 case 'i':case 'Ý':case '×':case 'Ø':case 'Þ':ch='Ü';break;
    415.                 case 'y':case 'ý':case 'ú':case 'û':case 'þ':ch='ü';break;
    416.                 case 'u':case 'ó':case 'ï':case 'ñ':case 'ô':ch='ò';break;
    417.                 case '­':case 'ø':case 'õ':case 'ö':case 'ù':ch='÷';break;
    418.                 case 'o':case 'ã':case 'ß':case 'á':case 'ä':ch='â';break;
    419.                 case '«':case 'è':case 'å':case 'æ':case 'é':ch='ç';break;
    420.                 case '¬':case 'í':case 'ê':case 'ë':case 'î':ch='ì';break;
    421.                 default : return 1;
    422.             }
    423.         return 0;
    424.     }
    425.     int tdkhong(char &ch)     //tra ve 0 them dau hoan thanh ko van de, 1 la ko hoan thanh co van de
    426.     {
    427.         switch(ch)
    428.             {
    429.                 case '·':case '¸':case 'µ':case '¶':case '¹':ch='a';break;
    430.                 case '½':case '¾':case 'Ç':case '¼':case 'Æ':ch='¨';break;
    431.                 case 'É':case 'Ê':case '»':case 'È':case 'Ë':ch='©';break;
    432.                 case 'Ï':case 'Ð':case 'Ì':case 'Î':case 'Ñ':ch='e';break;
    433.                 case 'Ô':case 'Õ':case 'Ò':case 'Ó':case 'Ö':ch='ª';break;
    434.                 case 'Ü':case 'Ý':case '×':case 'Ø':case 'Þ':ch='i';break;
    435.                 case 'ü':case 'ý':case 'ú':case 'û':case 'þ':ch='y';break;
    436.                 case 'ò':case 'ó':case 'ï':case 'ñ':case 'ô':ch='u';break;
    437.                 case '÷':case 'ø':case 'õ':case 'ö':case 'ù':ch='­';break;
    438.                 case 'â':case 'ã':case 'ß':case 'á':case 'ä':ch='o';break;
    439.                 case 'ç':case 'è':case 'å':case 'æ':case 'é':ch='«';break;
    440.                 case 'ì':case 'í':case 'ê':case 'ë':case 'î':ch='¬';break;
    441.                 default : return 1;
    442.             }
    443.         return 0;
    444.     }
    445.  
    446.  
    447.     void nhaptv(char *xau)
    448.     {
    449.         int max=29;// chieu dai toi da xau nhap vao
    450.         char ch='a';
    451.         int i=0;
    452.         int flag,flagch=-1;
    453.         int x=wherex(),y=wherey();
    454.         _setcursortype(_NORMALCURSOR);
    455.         while (ch!=0xD)
    456.            {
    457.             ch=getch();
    458.             if(ch==0) {getch();continue;}
    459.             if (ch==0xD) continue;
    460.             if (i>0&&ch==0x20&&xau[i-1]==0x20) continue; //bai binh thuong xoa dong nay
    461.             if (!(isalpha(ch)||isdigit(ch)||ch==0x20||ch==0x8)) continue;
    462.             if (i==0||xau[i-1]==0x20) ch=toupper(ch);
    463.                 else ch=tolower(ch);
    464.             flag=0;
    465.             if (ch==0x20) flagch=-1;
    466.             if (ch==8)
    467.                 {
    468.                     if (i>0) {printf("\b ");xau[--i]=NULL;}
    469.                 }
    470.             else switch(tolower(ch))
    471.                 {
    472.                     case 'a': switch(xau[i-1])
    473.                             {
    474.                                 case 'a' :  xau[i-1]='©'; break;
    475.                                 case 'A' :  xau[i-1]='¢'; break;
    476.                                 default  :  flag=1;break;
    477.                             };
    478.                           break;
    479.                     case 'd': switch(xau[i-1])
    480.                             {
    481.                                 case 'd' :  xau[i-1]='®'; break;
    482.                                 case 'D' :  xau[i-1]='§'; break;
    483.                                 default  :  flag=1;break;
    484.                             }
    485.                           break;
    486.                     case 'e': switch(xau[i-1])
    487.                             {
    488.                                 case 'e' :  xau[i-1]='ª'; break;
    489.                                 case 'E' :  xau[i-1]='£'; break;
    490.                                 default  :  flag=1;break;
    491.                             }
    492.                           break;
    493.                     case 'o': switch(xau[i-1])
    494.                             {
    495.                                 case 'o' :  xau[i-1]='«'; break;
    496.                                 case 'O' :  xau[i-1]='¤'; break;
    497.                                 default  :  flag=1;break;
    498.                             }
    499.                           break;
    500.                     case 'w': switch(xau[i-1])
    501.                             {
    502.                                 case 'o' :  xau[i-1]='¬'; break;
    503.                                 case 'O' :  xau[i-1]='¥'; break;
    504.                                 case 'u' :  xau[i-1]='­'; break;
    505.                                 case 'U' :  xau[i-1]='¦'; break;
    506.                                 case 'a' :  xau[i-1]='¨'; break;
    507.                                 case 'A' :  xau[i-1]='¡'; break;
    508.                                 default  :  flag=1;break;
    509.                             }
    510.                           break;
    511.                     case 's': if (flagch!=-1) flag=tdsac(xau[flagch]);
    512.                           else flag=1;
    513.                           break;
    514.                     case 'f': if (flagch!=-1) flag=tdhuyen(xau[flagch]);
    515.                           else flag=1;
    516.                           break;
    517.                     case 'r': if (flagch!=-1) flag=tdhoi(xau[flagch]);
    518.                           else flag=1;
    519.                           break;
    520.                     case 'x': if (flagch!=-1) flag=tdnga(xau[flagch]);
    521.                           else flag=1;
    522.                           break;
    523.                     case 'j': if (flagch!=-1) flag=tdnang(xau[flagch]);
    524.                           else flag=1;
    525.                           break;
    526.                     case 'z': if (flagch!=-1) flag=tdkhong(xau[flagch]);
    527.                           else flag=1;
    528.                           break;
    529.                     default : flag=1;break;
    530.                 }
    531.             if (flag) {xau[i++]=ch;xau[i]=NULL;}
    532.             if (i>1&&((xau[i-1]=='i'||xau[i-1]=='u'||xau[i-1]=='o')&&phuam(xau[i-2]))||(!phuam(xau[i-1])&&xau[i-1]!='i'&&xau[i-1]!='u'&&xau[i-1]!='o'))
    533.                 flagch=i-1;
    534.  
    535.             gotoxy(x,y);cprintf("%s",xau);
    536.  
    537.             if (i==max) break;
    538.            }
    539.         if (i==0) xau[i]=NULL;
    540.         _setcursortype(_NOCURSOR);
    541.         printf("\n");
    542.     }
    543.     void thoatf(void)  //giup cho thoat khoi che do tieng viet ma ko co bug
    544.     {
    545.         textmode(C40);
    546.         exit(0);
    547.     }
    548.     //**********************************END*************************************/
    549.     void main(void)
    550.     {
    551.         tiengviet();
    552.         char xau[50];
    553.         printf("NhËp tiÕng viÖt : ");
    554.         nhaptv(xau);
    555.         printf("\nX©u võa nhËp lµ : %s",xau);
    556.         getch();
    557.         thoatf();
    558.     }
    Attached Files Attached Files
    Đã được chỉnh sửa lần cuối bởi langman : 08-01-2013 lúc 03:28 PM.
    ^_,^

    Facebook : https://www.facebook.com/langmaninternet

    Bùi Tấn Quang

  4. #4
    Ngày gia nhập
    03 2011
    Nơi ở
    H3t.org
    Bài viết
    37

    Mặc định :D

    Muốn thank bác quá mà k có nút thank ở đâu nhỉ , hay quá

  5. #5
    Ngày gia nhập
    10 2010
    Bài viết
    2

    Em đã hiện được tiếng việt trong chế độ đồ họa theo cách của anh rồi. Mà có cách nào giảm font size nhỏ lại và khoảng cách giữa các chữ nhỏ lại được không anh? Thêm hàm hiện tiếng việt này vào làm tọa độ của chữ em bị lệch hết rồi

Các đề tài tương tự

  1. Dịch thuật tiếng Việt Nam sang Tiếng Pháp
    Gửi bởi ketnoits2012 trong diễn đàn Giới thiệu website, sản phẩm của bạn
    Trả lời: 0
    Bài viết cuối: 03-01-2013, 02:50 AM
  2. Dịch thuật tiếng Campuchia Uy tín trên toàn Quốc
    Gửi bởi ketnoits2012 trong diễn đàn Giới thiệu website, sản phẩm của bạn
    Trả lời: 0
    Bài viết cuối: 13-12-2012, 03:58 PM
  3. Dịch thuật Tiếng Thái Lan sang tiếng Việt
    Gửi bởi ketnoits2012 trong diễn đàn Giới thiệu website, sản phẩm của bạn
    Trả lời: 0
    Bài viết cuối: 14-11-2012, 10:40 AM
  4. Dịch Thuật tiếng Nhật Bản sang tiếng việt chuyên nghiệp
    Gửi bởi ketnoits2012 trong diễn đàn Giới thiệu website, sản phẩm của bạn
    Trả lời: 0
    Bài viết cuối: 07-11-2012, 09:37 AM
  5. Gọi tiến trình Hook API bằng tiến trình bị inject trên VC++ như thế nào?
    Gửi bởi AdminPro trong diễn đàn Windows API, Hooking, xử lý Windows Message
    Trả lời: 1
    Bài viết cuối: 24-05-2009, 12:50 AM

Quyền hạn của bạn

  • Bạn không thể gửi đề tài mới
  • Bạn không thể gửi bài trả lời
  • Bạn không thể gửi các đính kèm
  • Bạn không thể chỉnh sửa bài viết của bạn