1

Topic: Unicode?

How do you use unicode chars in teeworlds? I can use them here (°?) but not in teeworlds (at least not with the same method).

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

2

Re: Unicode?

teeworlds doesnt have support for all chars as it uses bitmap fonts (I think)(wtf btw), style your nick with the ones that exist instead wink

Official Teeworlds map developer and community moderator
Administrator for the Teeworlds community Teesites

3

Re: Unicode?

Ok, thanks.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

4

Re: Unicode?

also the c and c++ code only uses char and not any functions that provide utf-8. it's all iso-8859-1. if you want to convert this iso to utf-8 but in a char array you can use something like this:

    int i;
    int n = 0;
    for(i=0; querybuffer[i] != 0;i++)
    {
        if(querybuffer[i] > 0)
        {
            querybuffer_conversion[n++] = querybuffer[i];
        }
        else
        {
            querybuffer_conversion[n++] = (3<<6) | ((querybuffer[i] & (3 << 6)) >> 6);
            querybuffer_conversion[n++] = (querybuffer[i] & 63) | (1<<7);
        }
        
    }
    querybuffer_conversion[n] = 0;

querybuffer is the array in iso-8859-1. querybuffer_conversion should be 2*length of querybuffer to avoid segmentation faults. in querybuffer_conversion could appear some chars with binary code 110* at the beginning, so you have to use functions that detect those chars which are 2 byte long.
i hope that helps you at whatever you want to do there wink