~adj/civ3_cross_platform_editor#92: 
Decompression of files with non-ASCII characters fails on Windows

Trying to open a file such as 华夏春秋.biq fails, when it is compressed. After some investigation, I found that the editor can open files with non-ASCII names. However, if they are compressed, it passes the non-ASCII name to an outside process (Runtime.exec), and it seems this is not Unicode-safe on Windows. This causes the decompressor to fail as it doesn't get the right file name to decompress, and thus doesn't do anything.

I opened the BIQ Decompressor UI project, and confirmed that the decompression routine itself does not fail due to non-ASCII characters. But passing command line arguments to the BIQ Decompressor (console) application in NetBeans doesn't work. And I found a StackOverflow thread (https://stackoverflow.com/questions/7660651/passing-command-line-unicode-argument-to-java-code) confirming what I'd been seeing.

I think the work-around would be to store the name of the file to decompress in a Unicode .txt file, and have the decompressor read that. It's silly, but I think it would work. Other options include JNI (which I'm not sure wouldn't break stuff on other systems), and chcp 65001, which I've read is buggy and which I'm not sure would really work with the Runtime.exec call.

Status
REPORTED
Submitter
bitbucket:QuintillusCFC
Assigned to
No-one
Submitted
7 years ago
Updated
1 year, 2 months ago
Labels
bug verify-status

~adj 1 year, 2 months ago

Adding verify-status to see if this remains an issue on Windows 10+.

Register here or Log in to comment, or comment via email.