Skip to content

Adding support for files as UTF-8 and Shift-JSI/SJIS encoding#58

Open
azerios wants to merge 25 commits into
Sicos1977:masterfrom
azerios:master
Open

Adding support for files as UTF-8 and Shift-JSI/SJIS encoding#58
azerios wants to merge 25 commits into
Sicos1977:masterfrom
azerios:master

Conversation

@azerios

@azerios azerios commented May 5, 2026

Copy link
Copy Markdown
Contributor

Using files having UTF-8 and Shift-JSI/SJIS encoding it's possible to extract Japanese words which are inside.

Fixing #56

Usage example

// Enable encoding detection for Japanese text files
var options = new FilterReaderOptions 
{ 
    UseEncodingDetection = true 
};

// Read UTF-8 encoded Japanese file
using (var reader = new FilterReader("japanese_utf8.txt", filterReaderOptions: options))
{
    var content = reader.ReadToEnd();
    Console.WriteLine(content); // Correctly displays: テスト
}

// Read Shift-JIS encoded Japanese file
using (var reader = new FilterReader("japanese_shiftjis.txt", filterReaderOptions: options))
{
    var content = reader.ReadToEnd();
    Console.WriteLine(content); // Correctly displays: テスト
}

// Search for Japanese text in log files
var searchReader = new IFilterTextViewer.Reader(options);
bool found = searchReader.FileContainsText("app.log", "エラー", ignoreCase: true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant