Unicode fix for colored printing

strcspn() call is replaced with unicode-aware counting loop.