mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- changed zstrformat to allow %c to emit non-ASCII characters as UTF-8.
This commit is contained in:
parent
b29975503d
commit
91206f12be
2 changed files with 7 additions and 5 deletions
|
@ -89,6 +89,7 @@
|
||||||
|
|
||||||
#include "zstring.h"
|
#include "zstring.h"
|
||||||
#include "gdtoa.h"
|
#include "gdtoa.h"
|
||||||
|
#include "utf8.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -557,8 +558,11 @@ namespace StringFormat
|
||||||
else if (type == 'c')
|
else if (type == 'c')
|
||||||
{
|
{
|
||||||
intarg = va_arg (arglist, int);
|
intarg = va_arg (arglist, int);
|
||||||
buffer[0] = char(intarg);
|
if (utf8_encode(intarg, (uint8_t*)buffer, &bufflen) != 0)
|
||||||
bufflen = 1;
|
{
|
||||||
|
buffer[0] = '?';
|
||||||
|
bufflen = 1;
|
||||||
|
}
|
||||||
obuff = buffer;
|
obuff = buffer;
|
||||||
}
|
}
|
||||||
else if (type == 's')
|
else if (type == 's')
|
||||||
|
|
|
@ -209,9 +209,7 @@ class TextEnterMenu : Menu
|
||||||
|
|
||||||
private void AppendChar(int ch)
|
private void AppendChar(int ch)
|
||||||
{
|
{
|
||||||
String newstring = mEnterString;
|
String newstring = String.Format("%s%c%s", mEnterString, ch, displayFont.GetCursor());
|
||||||
newstring.AppendCharacter(ch);
|
|
||||||
newstring = newstring .. displayFont.GetCursor();
|
|
||||||
if (mEnterSize < 0 || displayFont.StringWidth(newstring) < mEnterSize)
|
if (mEnterSize < 0 || displayFont.StringWidth(newstring) < mEnterSize)
|
||||||
{
|
{
|
||||||
mEnterString.AppendCharacter(ch);
|
mEnterString.AppendCharacter(ch);
|
||||||
|
|
Loading…
Reference in a new issue