Skip to content

Windows: Cannot open/save files with paths/folders containing non-standard characters #2290

@jtanx

Description

@jtanx

On Windows, functions like fopen/opendir/stat all only accept filenames in the current active codepage, which excludes opening files with characters outside of that codepage (e.g. Chinese and Cyrillic characters for a Windows/English setup).

Some aspects (like directory scanning) can be easily solved by using GLib and passing UTF-8 encoded filenames on Windows. Other aspects are less easily solved, as most function calls involving files are spread out, and most assume u2def (Unicode to default character encoding) is sufficient when it is not (on Windows - 99.9% of the time the default charset is 8859-1).


To be fixed:

  • fopen/open (in Gnulib)
  • freopen (not used)
  • opendir/readdir
  • rmdir (Unused; removed GFileRmDir)
  • unlink
  • access
  • mkdir
  • getenv
  • u2def -->u2fsys / def2u --> fsys2u as necessary
  • stat/lstat
  • rename
  • remove (present in gtkui; left unchanged; unused elsewhere)
  • chmod (unused)
  • chdir
  • creat? (unused)
  • fsys functions
    • GFileGetHomeDocumentsDir - trailing slash
  • Font loading code
  • endswithi is broken
  • Check all instances of tolower

Anything else from https://developer.gnome.org/glib/stable/glib-File-Utilities.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions