SQLite Forum

[BUG] Precompiled sqlite shell for windows can't open filenames with unicode chars
Login
In order to get MinGW/GCC on Windows to produce a a working unicode (wmain) executable the `-municode` directive was required on the gcc command line.

Also `-DSQLITE_SHELL_IS_UTF8=(0)` because the current shell.c only sets this for MSVC compilers on Windows, not GCC.

The MSVC compiler seemed to drag in the correct unicode (wmain) correctly without making any changes.

Changing this block in shell.c.in

```
#ifndef SQLITE_SHELL_IS_UTF8
#  if (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
#    define SQLITE_SHELL_IS_UTF8          (0)
#  else
#    define SQLITE_SHELL_IS_UTF8          (1)
#  endif
#endif
```
to

```
#ifndef SQLITE_SHELL_IS_UTF8
#  if (defined(_WIN32) || defined(WIN32)) && (defined(_MSC_VER) || (defined(UNICODE) && defined(__GNUC__)))
#    define SQLITE_SHELL_IS_UTF8          (0)
#  else
#    define SQLITE_SHELL_IS_UTF8          (1)
#  endif
#endif
```

fixes this so that only the -municode compiler option is necessary to make this work with a GCC compiler targetting Windows, and without the option a narrow character version will be produced.