configdir is initially in locale (glib) encoding. Converting it from UTF-8 is wrong (for example, "Р±РѕР·Р°" becomes "боза" on my system), and it must be converted _to_ UTF-8 when used in geany_debug() - otherwise, Help -> Debug Messages terminates Geany with an assertion. This is for POSIX only, under Windows the glib encoding is also UTF-8.
I replaced "alternate configdir %s" and "creating config directory %s" with static texts, because the directory is shown shortly after them as "User config dir: %s" anyway, and I don't want to create and free an utf8_configdir two more times.
dialogs_show_msgbox() in create_config_dir() are for the default directory only, and thus do not require conversion. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/658
-- Commit Summary --
* Fix configdir encoding
-- File Changes --
M src/libmain.c (12)
-- Patch Links --
https://github.com/geany/geany/pull/658.patch https://github.com/geany/geany/pull/658.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/658
LGTM.
dialogs_show_msgbox() in create_config_dir() are for the default directory only, and thus do not require conversion.
AFAICT they do, in case the default directories (`HOME` or `XDG_CONFIG_HOME`) contain bytes that would result in an invalid conversion (basically, non-ASCII stuff when locale encoding isn't UTF-8).
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/658#issuecomment-152346750
Closed #658 via e44e00afe02c980068cbca0ca3870b0b2a663397.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/658#event-449853323
github-comments@lists.geany.org