char *fossil_unicode_to_utf8(void *zUnicode){
#ifdef _WIN32
  int nByte = 0;
  char *zUtf;
  WCHAR *wUnicode = zUnicode;
/*
This my have problem when zUnicode is readonly.
And it's will modify zUnicode when sometimes we did not want to modify it.
*/
  while( *wUnicode != 0 ){
    if ( (*wUnicode > 0xF000) && (*wUnicode <= 0xF07F) ){
      *wUnicode &= 0x7F;
    }
    ++wUnicode;
  }
  nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0);
  zUtf = sqlite3_malloc( nByte );
  if( zUtf==0 ){
    return 0;
  }
  WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, zUtf, nByte, 0, 0);
  return zUtf;
#else
  return (char *)zUnicode;  /* No-op on unix */
#endif
}


void *fossil_utf8_to_unicode(const char *zUtf8){
#ifdef _WIN32
/* nWord should be meaningful than nByte here*/
  int nByte = MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, 0, 0);
  wchar_t *zUnicode = sqlite3_malloc( nByte * 2 );
  wchar_t *wUnicode;
  if( zUnicode==0 ){
    return 0;
  }
  MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, zUnicode, nByte);
  wUnicode = zUnicode;
  while( --nByte > 0){
    if ( (*wUnicode < 32) || wcschr(L"\"*<>?|", *wUnicode) ){
      *wUnicode |= 0xF000;
    }
    ++wUnicode;
  }

  return zUnicode;
#else
  return (void *)zUtf8;  /* No-op on unix */
#endif
}