summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2020-10-12 12:09:42 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2020-10-12 12:12:33 +0100
commit7072d57d12036964ff4f54405df7f8fe851d7982 (patch)
treef743adf159631330169b1b2a5d741e83a9908971
parent57b0ac9b42128ef4dfd388a15679c05ba982116c (diff)
downloadgtk+-7072d57d12036964ff4f54405df7f8fe851d7982.tar.gz
gtkfilechooser: Fix open() references in documentation
While it’s true that you can pass the results of `gtk_file_chooser_get_filename()` straight to `open()` or `fopen()` on Linux, you can’t do so on Windows as it expects the filename to be in the ANSI codepage. Using the GLib wrappers `g_open()`/`g_fopen()` instead means that the appropriate UTF-8 → UTF-16 → `wopen()`/`wfopen()` conversions are done. Spotted by Fabian Keßler in https://gitlab.gnome.org/GNOME/glib/-/issues/2212. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--gtk/gtkfilechooser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index 4e22c52b06..0be35921e1 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -68,7 +68,7 @@
* variable.
*
* This means that while you can pass the result of
- * gtk_file_chooser_get_filename() to open() or fopen(),
+ * gtk_file_chooser_get_filename() to g_open() or g_fopen(),
* you may not be able to directly set it as the text of a
* #GtkLabel widget unless you convert it first to UTF-8,
* which all GTK+ widgets expect. You should use g_filename_to_utf8()