Skip to content

Conversation

@vrane-tibco
Copy link
Collaborator

@vrane-tibco vrane-tibco commented Jul 1, 2025

This change updates the _pathlike_to_fileptr function to handle Unicode file paths across platforms.(Fix for #80)

  1. On Windows:

     Uses _wfopen() instead of fopen() for file opening.
     
     Converts Python str and bytes objects to wchar_t* to support non-ASCII paths (e.g., filenames with Japanese, Chinese, or other Unicode characters).
     
     Avoids reliance on system locale settings or the "Beta: UTF-8" flag.
    
  2. On POSIX systems:

     Continues using fopen() with UTF-8 encoded char*.
    
     Utilizes PyUnicode_FSConverter() to convert Python str objects appropriately.
    

@vrane-tibco vrane-tibco merged commit a5067d4 into main Jul 10, 2025
45 checks passed
@vrane-tibco vrane-tibco deleted the 80-sdbfpath-unicode-support branch July 10, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants