- if( rec->m_eResult == k_EResultOK )
- {
- vg_info( "Recieved stats for: %lu (user: %lu)\n", rec->m_nGameID,
- rec->m_steamIDUser );
- steam_stats_ready = 1;
- }
- else
- {
- vg_error( "Error recieveing stats for user (%u)\n", rec->m_eResult );
+ for(;i < length-1;){
+ if( ustr[i] == 0x00 )
+ break;
+
+ if( ustr[i] & 0x80 ){
+ if( utf32_byte_ct ){
+ utf32_byte_ct --;
+ utf32_code |= (ustr[i] & 0x3F) << (utf32_byte_ct*6);
+
+ if( !utf32_byte_ct ){
+ const char *match;
+ size_t chars = anyascii( utf32_code, &match );
+
+ for( u32 k=0; k<VG_MIN(chars, length-1-j); k++ ){
+ buf[ j++ ] = (u8)match[k];
+ }
+ }
+ }
+ else{
+ utf32_byte_ct = utf8_byte0_byte_count( ustr[i] )-1;
+ utf32_code = ustr[i] & (0x3F >> utf32_byte_ct);
+ utf32_code <<= utf32_byte_ct*6;
+ }
+ }
+ else{
+ utf32_byte_ct = 0x00;
+ buf[j ++] = str[i];
+ }
+
+ i++;