Comments (19)
utf_8_char
also fails when we run it on Window against our Java parser lib. Our debug output seems to suggest that the the ctest process is using an improper encoding when passing the Asian file path to our executable. This is the relevant section of Testing/Temporary/LastTest.log
. Note that ctest lists the command properly with 中文.txt
, but our executable sees ??.txt
. Is there any cmake option to fix this?
89/179 Testing: utf_8_char
89/179 Test: utf_8_char
Command: "C:/Program Files/Java/jdk1.7.0/bin/java.exe" "-cp" "C:/projects/ec4j/core/target/org.eclipse.ec4j.core.jar" "org.eclipse.ec4j.core.cli.Cli" "-f" "utf8char.in" "C:/projects/ec4j/core/editorconfig-core-test/glob/中文.txt"
Directory: C:/projects/ec4j/core/editorconfig-core-test/glob
"utf_8_char" start time: Nov 12 18:48 Coordinated Universal Time
Output:
----------------------------------------------------------
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <?> at index 50: C:/projects/ec4j/core/editorconfig-core-test/glob/??.txt
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at org.eclipse.ec4j.core.cli.Cli.main(Cli.java:117)
<end of output>
Test time = 0.09 sec
----------------------------------------------------------
Test Fail Reason:
Required regular expression not found.Regex=[^key=value[
]*$
]
"utf_8_char" end time: Nov 12 18:48 Coordinated Universal Time
"utf_8_char" time elapsed: 00:00:00
----------------------------------------------------------
from editorconfig-core-c.
Hmm, have you reported to cmake? If so, can you point out the link?
from editorconfig-core-c.
I am sort of curious about this: I successfully ran all tests on Windows before. Do you have any idea why this is happening?
from editorconfig-core-c.
have you reported to cmake?
No.
Do you have any idea why this is happening?
No, no idea. I am very new to cmake.
Well, as I said in my previous post, I actually have a suspection that the problem is somewhere between cmake and the executable. Either cmake or windows shell or whatever else there in between uses an improper encoding when passing the path to the executable.
from editorconfig-core-c.
Where did you obtain cmake?
from editorconfig-core-c.
Where did you obtain cmake?
It is available by default on AppVeyor. No idea where they have it from. In any case, the version is 3.9.6 - see https://ci.appveyor.com/project/xuhdev/editorconfig-core-c/build/1.0.3#L5
from editorconfig-core-c.
@ppalaga I had one thought: maybe it's the PCRE library? We seem to have built the 8-bit version.
from editorconfig-core-c.
8-bit version
Are you sure it is possible to build an 8 bit in 2017? (Maybe a stupid question. I am really new to cmake)
from editorconfig-core-c.
It's in the AppVeyor output:
-- PCRE configuration summary:
--
-- Install prefix .................. : C:/projects/bin/x64-static/build
-- C compiler ...................... : C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
-- C++ compiler .................... : C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/Hostx86/x64/cl.exe
-- C compiler flags ................ : /DWIN32 /D_WINDOWS /W3
-- C++ compiler flags .............. : /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--
-- Build 8 bit PCRE library ........ : ON
-- Build 16 bit PCRE library ....... : OFF
-- Build 32 bit PCRE library ....... : OFF
-- Build C++ library ............... : OFF
from editorconfig-core-c.
Indeed, 8 bit in 2017!
from editorconfig-core-c.
I tried to look this up again: I don't think it's the 8-bit issue. From its readme, it looks like the 8-bit library supports UTF-8. Instead, I suspect these two lines are the culprit:
-- Enable UTF support .............. : OFF
-- Unicode properties .............. : OFF
from editorconfig-core-c.
@xuhdev @ppalaga See https://ci.appveyor.com/project/chcg/editorconfig-core-c/build/1.0.12
, also with PCRE_SUPPORT_UTF ON the windows test for utf8 support is failing. This is probably due to the issue that windows is using UTF16 for the unicode support, see
https://stackoverflow.com/questions/2050973/what-encoding-are-filenames-in-ntfs-stored-as.
So this seems to be an issue not easily resolvable on windows with the normal c library file accesses.
from editorconfig-core-c.
@chcg I do not think UTF16@NTFS is the problem. core-c lib is not opening the file. The path is just a string that gets matched against some glob patterns. From what I saw debugging ec4j java impl. The problem was somewhere between ctest, windows shell and our ec4j executable. Somebody more experienced in c programming than me should try to add some debug output to the core-c to see what bytes is it getting for the asian file name. I assume one will see some broken string like ??.txt
like we see with ec4j.
from editorconfig-core-c.
@ppalaga Have you tried to run the tests on your own Windows system? Or at least run the executable on some Unicode file names? I've never had this issue on my system before. But I'm not sure whether appveyor configures something differently.
from editorconfig-core-c.
Have you tried to run the tests on your own Windows system?
Sorry, appveyor is the only Windows system at my disposal.
from editorconfig-core-c.
If we don't know the reason for now, perhaps the best compromise is to disable this test on Windows on AppVeyor for EditorConfig C Core only. Do you have any idea how to do this?
from editorconfig-core-c.
@xuhdev See editorconfig/editorconfig-core-test#18
from editorconfig-core-c.
As I mentioned in the PR, you can use the -E
option when calling ctest
much like we did in ec4j ec4j/ec4j@1c84965#diff-180360612c6b8c4ed830919bbb4dd459R31
from editorconfig-core-c.
@ppalaga Many thanks! I followed your method and disabled the test case utf_8_char
successfully.
from editorconfig-core-c.
Related Issues (20)
- Bug: Star is not treated as a literal character inside brackets HOT 4
- Bug: 0 is not considered a valid number for {num1..num2} HOT 2
- Please keep CHANGELOG up-to-date for easier downstream parsing HOT 1
- Brace pairing check in ec_glob.c incorrect? HOT 8
- Unchecked malloc return value
- Header files define reserved identifiers
- Usage of atoi() invokes undefined behaviour on integer overflow
- .editorconfig files with syntax errors can cause property lookup to fail, even if the file is in a directory beneath the "root" config HOT 2
- Clarify dependencies
- Glob: Handling of `?` HOT 7
- Chocolatey package is out of date
- Segfault while reading .editorconfig generated by JetBrains IDE HOT 9
- `editorconfig_parse()` leaks memory when no `.editorconfig` files are found or there are no values HOT 1
- 0.12.5: BUILD_STATICALLY_LINKED_EXE=OFF and static library is build and installed HOT 3
- Unexpected behavior on trailing slash HOT 1
- flatpak-builder: 'submodule' is not a git command HOT 1
- Missing MIT license text for CMake_Modules/FindPCRE2.cmake HOT 1
- Path to using a system copy of inih? HOT 2
- Not passing -vsver to subsequent calls of build.ps1
- Path splitting algorithm isn't UNC-aware
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from editorconfig-core-c.