2008/9/7 Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx>: >> + default: >> + // 2-, 3-, or 4-byte UTF-8 character >> + { >> + char *str = new char[size + 1]; >> + strncpy(str, &(chars[offset]), size); >> + str[size] = 0; >> + printf("%s", str); >> + delete [] str; >> + } The code in the block could be simplified too: printf("%.*s", (int)size, &chars[offset]); - Michael