Skip to content

Japanese Windows 2byte code #880

@IamKojiFurukawa

Description

@IamKojiFurukawa

能率.csv
**Describe the bug**
A concise description of the problem you found with cloc.
Using with Japanese Windows 2byte code file name.
cloc; OS; OS version

  • cloc version:2.02
  • If running the cloc source, Perl version:
  • OS (eg Linux, Windows, macOS, etc): Windows
  • OS version: 11h2

To Reproduce
Steps one can follow reproduce the behavior you're seeing.
cloc.exe 能率.c
cloc.exe 日本語\source

included japanese 2byte code in path

Expected result
A concise description of what you expected to happen.
The cloc command can not find source files.

Additional context
Add any other context about the problem here.

Hello
The cloc command is very useful.
On Japanese Windows, there seems to be a problem if the path name is Japanese double byte code.
Do not convert between uppercase and lowercase characters. Do not convert between backslashes and slashes.
The <: encoding (shiftjis)
#ex: open_file("<:encoding(shiftjis)", $file, 1);

Japanese windows use Shift-JIS code for file path
#import use Encode qw(encode decode);
#ex. open mode: open(my $fh,"<:encoding(shiftjis)", $file);
#do not this# $file =~ s{\}{/}g if $ON_WINDOWS;
#this is not good# $upper_lower_map{$lc} = $file;

Please fix it.
Thank you.
Koji Furukawa

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions