• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Tatsh / dbeaver-creds / 25115992106
100%

Build:
DEFAULT BRANCH: master
Ran 29 Apr 2026 02:50PM UTC
Jobs 3
Files 4
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Apr 2026 02:49PM UTC coverage: 100.0%. Remained the same
25115992106

push

github

Tatsh
c: handle utf-8 paths end-to-end on windows

Previously the Windows code used the A-variant Win32 entry points
(`GetEnvironmentVariableA`, plain `fopen`, ANSI `argv`), which all
go through the active code page (CP_ACP). A `%APPDATA%` containing
non-ASCII characters (a user name like `Müller`, anything in CJK)
would either round-trip lossily through CP_ACP or fail outright on
machines whose code page can't represent the path. Same problem for
explicit-path arguments handed to the CLI - the CRT's `argv` is
ANSI, so a path supplied on a UTF-8 console got mangled before it
even reached `get_dbeaver_credentials`.

Switch the Windows code to the W-variant APIs throughout, with the
public `get_dbeaver_credentials(const char *path, ...)` boundary
remaining UTF-8:

New helper module (Windows-only):

  src/win_utf8.h
  src/win_utf8.c

  - `dbc_utf16_to_utf8` and `dbc_utf8_to_utf16` wrap
    `WideCharToMultiByte`/`MultiByteToWideChar` with `CP_UTF8`,
    returning malloc'd buffers.
  - `dbc_fopen_utf8` converts both path and mode arguments to
    UTF-16 and calls `_wfopen`.

src/api.c (Windows branch only):

  - `find_config_path`: `GetEnvironmentVariableW(L"APPDATA", ...)`,
    then `dbc_utf16_to_utf8` to produce the UTF-8 string the rest
    of the function appends to.
  - `read_all`: `dbc_fopen_utf8(path, "rb")` instead of `fopen`.
    POSIX path is unchanged.

src/main.c (Windows branch only):

  - Ignores the CRT's ANSI argv. Calls `GetCommandLineW` +
    `CommandLineToArgvW` to obtain the genuine UTF-16 command line,
    then converts `wargv[1]` (if present) to UTF-8 via
    `dbc_utf16_to_utf8`. `LocalFree`s `wargv`; the converted
    `path_buf` is `free`d via the CRT allocator (different
    allocators must not be mixed - hence the explicit copy).
  - Calls `SetConsoleOutputCP(CP_UTF8)` so JSON containing non-ASCII
    bytes renders correctly in the legacy `cmd.exe`/`conhost.exe`
    consoles. Windows Terminal already defaults to UTF-8.
  - POSIX `main` i... (continued)

147 of 147 relevant lines covered (100.0%)

6.48 hits per line

Jobs
ID Job ID Ran Files Coverage
1 native-Linux - 25115992106.1 29 Apr 2026 02:50PM UTC 2
100.0
GitHub Action Run
2 pwsh - 25115992106.2 29 Apr 2026 02:50PM UTC 1
100.0
GitHub Action Run
3 native-macOS - 25115992106.3 29 Apr 2026 02:50PM UTC 2
96.7
GitHub Action Run
Source Files on build 25115992106
  • Tree
  • List 4
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25115992106
  • 6901c208 on github
  • Prev Build on master (#25114672914)
  • Next Build on master (#25116329143)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc