AlDanial / cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
GNU General Public License v2.0
19.48k stars 1.02k forks source link

--read-lang-def=c:\repos\my_definitions.txt can not read a Windows Unicode file #414

Closed stampes closed 5 years ago

stampes commented 5 years ago

While waiting for an official build containing #413 while using Dyalog APL then I tried to make my own my_definitions.

As the comment character in APL is unicode then I have to save the file i Unicode format (on Windows) and neither of the supported formats containing unicode can be read by the read-lang-def command:

C:\repos\ims\src\Functions\mACC\ACCFAPCHK>c:\repos\cloc-1.82.exe  --read-lang-def=c:\repos\my_definitions.txt .
Missing computer language name, line 1 of c:\repos\my_definitions.txt

My definition file looks like:

APL    
    filter remove_matches ^\s*⍝
    extension aplf
    extension apl
    3rd_gen_scale 2.5
stampes commented 5 years ago

I do understand very little of Perl- but it looks like it should be around https://github.com/AlDanial/cloc/blob/e2ecba8957b1e09b6dd65b3a5745a3d33c655720/cloc#L4145 there ned to be some kind of handling of this?

AlDanial commented 5 years ago

With v1.84 out and supporting APL I've little motivation to work this issue. I will update the list of limitations with a remark that cloc cannot handle language definition files with Unicode characters.