Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
processing: add windows support to exportRasterLayersIntoDirectory (f…
…ixes #20146)
- Loading branch information
Showing
2 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getWindowsCodePage() return 1252-ansi (only correct for windows itself). But you need/mean the cmd.exe-console and it speaks MSDOS cp850.
https://gis.stackexchange.com/questions/302457/qgis-3-4-error-utf-8-codec-cant-decode-byte-0xe8-in-position-50-invalid-cont/302526?noredirect=1#comment488995_302526
b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corresponds to the chcp in line 256.
b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but grass74.bat contains the line
if %ERRORLEVEL% GEQ 1 pause
This Output
is cp850 and the code failed
b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, not really sure why the
chcp
was introduced in 6c81895 - guess to handle filenames with non-ascii characters in the produced batch job - but there's apparently no recoding of filename from UTF-8. After thechcp
pause
also produces cp1252. Just the message frompause
after an error is still cp850 - everything else will be cp1252 (or whatever codepageGetACP()
returns). So changing back tocp850
also doesn't seem to be a better choice. Maybe we should startgrass74.bat
from another batchfile and runchcp
upfront (maybe even with65001
- ie. UTF-8).b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also getting an error, due to this issue with portuguese regional settings:
b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EZUSoft
Can you check which Active Code Page do you have in Windows Console?
I tried the updated QGIS 3.4.2-11 in another machine, and it worked without this issue. So I checked the Code Page and it is 850.
In the buggy machine, it was 65001. I had changed the default code page in this machine long time ago (Regional Settings -> Language for non-Unicode programs -> and marked the beta option "Use Unicode UTF-8 for worldwide language support"). Unchecking it, the problem goes away.
b39e5a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that removing the "Use Unicode UTF-8 for worldwide language support" option solves the issue.