}
// remove the last newline of the copied text
if (ucsbuf[p-1]=='\n')
{
ucsbuf[p-1] = 0;
#ifdef _WIN32
ucsbuf[p-2] = 0;
#endif
ucsbuf[p] = 0;