LINUX.ORG.RU

История изменений

Исправление quest, (текущая версия) :

#include <slang.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <termios.h>

int main()
{
    SLtt_get_terminfo();
    if (SLang_init_tty(-1, 0, 1) == -1) return 1;
    if (SLsmg_init_smg() == -1) return 1;
    if (SLutf8_enable(-1) == 0) return 1;
    if (SLsmg_utf8_enable(-1) == 0) return 1;
    if (SLtt_utf8_enable(-1) == 0) return 1;
    if (SLinterp_utf8_enable(-1) == 0) return 1;

    uint8_t ch[] = { "د" }; // korean unicode sign

    SLsmg_write_string(ch);
/*
    uint8_t *p = ch;
    while (*p != 0)
    {
        SLsmg_write_char(*p);
        p++;
    }
*/

    SLsmg_refresh();
    SLang_getkey();
    SLsmg_reset_smg();
    SLang_reset_tty();
    return 0;
}

Исходная версия quest, :

#include <slang.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <termios.h>

int main()
{
    SLtt_get_terminfo();
        if (SLang_init_tty(-1, 0, 1) == -1) return 1;
        if (SLsmg_init_smg() == -1) return 1;
        if (SLutf8_enable(-1) == 0) return 1;
        if (SLsmg_utf8_enable(-1) == 0) return 1;
        if (SLtt_utf8_enable(-1) == 0) return 1;
        if (SLinterp_utf8_enable(-1) == 0) return 1;

        uint8_t ch[] = { "د" };

        SLsmg_write_string(ch);
/*
        uint8_t *p = ch;
        while (*p != 0)
        {
                SLsmg_write_char(*p);
                p++;
        }
*/

        SLsmg_refresh();
        SLang_getkey();
        SLsmg_reset_smg();
        SLang_reset_tty();
        return 0;
}