-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Unicode filenames on Windows #537
Comments
To answer your question, this suggestion is not practical for leptonica. Such filenames need to be converted outside the library. Dan |
Dan, thank you for the quick response. |
@tyomitch, is this true for any Do you have a link to some documentation which explains the described restriction? |
According to MS documentation, it is possible to set the code page to UTF-8. So any Windows program can set the desired code page and there seems to be no need to handle that mess in the Leptonica code. |
Not necessarily; as for the three stdlib implementations that README.md mentions (MSVC, MinGW, Cygwin): MSVC reference: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen
MinGW AFAICT forwards calls to Cygwin uses special escape sequences for a workaround, as documented in https://fossies.org/windows/misc/cygwin-20200909-src-x86_64.tar.xz:b/cygwin-snapshot-20200909-1/winsup/cygwin/strfuncs.cc lines 386-394
Only available in Windows Version 1903 (May 2019 Update) or above :-( |
Dan, any reason to not close this issue ('Wontfix') ? |
No reason not to. "Won't fix" is accurate.
…On Fri, Jun 25, 2021 at 8:58 AM Amit D. ***@***.***> wrote:
Dan, any reason to not close this issue ('Wontfix') ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7KMLCVAR5CIWH2NR7ICGTTUSRRHANCNFSM4RKYC3WA>
.
|
You forgot to click the 'Close issue' button. |
Hey Amit -- I was going to give you that pleasure :-)
…On Sun, Jun 27, 2021 at 1:59 AM Amit D. ***@***.***> wrote:
You forgot to click the 'Close issue' button.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#537 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7KMLAFHKTHCDMKL2XWMDLTU3SABANCNFSM4RKYC3WA>
.
|
As of now,
fopenReadStream
andfopenWriteStream
callfopen(3)
which on Windows maps toCreateFileA
.This makes it impossible to read or write files whose names include Unicode codepoints not representable in the user's default code page.
Is there any hope of upgrading Leptonica to use Unicode strings, either UTF-8 or UTF-16, for filenames, and to use
_wfopen
on Windows?To avoid breaking backwards compatibility, each API entry point accepting a filename would need to be duplicated, e.g. as
pixReadW
,pixWriteW
,pixaReadMultipageTiffW
.The text was updated successfully, but these errors were encountered: