strlennocol: fix color codes :P git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10641 d7cf8633-e32d-0410-b094-e92efae38249
Fix again u8_COM_StringLengthNoColors returning always 0 if end is NULL (strlennocol case), and counting 1 less character if the last character is multibyte and end is not NULL Signed-off-by: terencehill <piuntn@gmail.com> git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10492 d7cf8633-e32d-0410-b094-e92efae38249
clean up u8_StringLengthNoColors git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10440 d7cf8633-e32d-0410-b094-e92efae38249
Fix u8_COM_StringLengthNoColors not counting many ASCII chars (up to '?') Better handling of invalid chars in u8_COM_StringLengthNoColors git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10438 d7cf8633-e32d-0410-b094-e92efae38249
fix typo in utf8 lib making characters U+1XXXX impossible git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9840 d7cf8633-e32d-0410-b094-e92efae38249
get rid of a warning git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9744 d7cf8633-e32d-0410-b094-e92efae38249
fix alignment of fps counter with ft2 fonts, and other alignment issues git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9740 d7cf8633-e32d-0410-b094-e92efae38249
using tables for u8_analyze to speed it up git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9734 d7cf8633-e32d-0410-b094-e92efae38249
factor out the non-utf8 part of u8_get*char into macros git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9730 d7cf8633-e32d-0410-b094-e92efae38249
fixed an inconsistency in u8_analyze git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9713 d7cf8633-e32d-0410-b094-e92efae38249
with utf8 disabled, u8_byteofs must still behave correctly, also u8_bytelen w/o utf8 should not behave differently git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9712 d7cf8633-e32d-0410-b094-e92efae38249
set the unicode value to 0 if no value exists, also changing u8_fromchar to not return values < 0 but just 0 - it's easier to use that way git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9698 d7cf8633-e32d-0410-b094-e92efae38249
u8_get{n,}char should advance the end-ptr even if no valid character was found so it at least points to the \0 or to after maxlen git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9691 d7cf8633-e32d-0410-b094-e92efae38249
'<=' fail: '< 0xC2' means invalid '== 0xC2' does not, I had it right in the comment... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9687 d7cf8633-e32d-0410-b094-e92efae38249
fix u8_COM_StringLengthNoColors the same way other functions handle signedness git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9686 d7cf8633-e32d-0410-b094-e92efae38249
utf8: add VM_sprintf support now sprintf("%#10s", s) pads to 10 bytes, and sprintf("%10s", s) pads to 10 characters, if utf8 is enabled git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9685 d7cf8633-e32d-0410-b094-e92efae38249
make utf8 functions safer: give them a size limit in memory, to allow working with non-NUL-terminated strings git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9646 d7cf8633-e32d-0410-b094-e92efae38249
... forgot to add the files, I'm too used to git now :P git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9642 d7cf8633-e32d-0410-b094-e92efae38249