Logo
Explore Help
Sign In
starred/qemu-qemu-1
1
0
Fork 0
You've already forked qemu-qemu-1
mirror of https://github.com/qemu/qemu.git synced 2026-07-08 17:56:38 +00:00
Code Issues Packages Projects Releases Wiki Activity
Files
master
qemu-qemu-1/ui/cp437.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
223 B
C
Raw Permalink Normal View History

ui/console-vc: add UTF-8 input decoding with CP437 rendering The text console receives bytes that may be UTF-8 encoded (e.g. from a guest running a modern distro), but currently treats each byte as a raw character index into the VGA/CP437 font, producing garbled output for any multi-byte sequence. Add a UTF-8 decoder using Bjoern Hoehrmann's DFA. The DFA inherently rejects overlong encodings, surrogates, and codepoints above U+10FFFF. Completed codepoints are then mapped to CP437, unmappable characters are displayed as '?'. Note that QEMU has a "buffered" utf8 decoder in util/unicode.c, but it is not a good fit for byte-per-byte decoding. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2026-03-12 17:29:29 +04:00
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Copyright (c) QEMU contributors
*/
#ifndef QEMU_CP437_H
#define QEMU_CP437_H
#include <stdint.h>
int unicode_to_cp437(uint32_t codepoint);
#endif /* QEMU_CP437_H */
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 287ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API