Straightforward call of XChangeProperty() should do the trick:
XChangeProperty( display, win,
XInternAtom(display, "_NET_WM_NAME", False),
XInternAtom(display, "UTF8_STRING", False),
8, PropModeReplace, (unsigned char *) utf8_buffer,
count);