Project

General

Profile

Actions

Defect #40020

closed

ScmData.binary? incorrectly considers UTF-8 text as binary

Added by Go MAEDA 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
SCM
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Currently, the binary? method in Redmine::Scm::Adapters::ScmData often misclassifies Unicode text as binary. This is because the method actually checks whether the given data is ASCII text or not.

The new implementation in the attached patch checks for control characters excluding tabs, newlines, and carriage returns, and calculates their proportion in the data. It ensures accurate detection of binary data while properly handling Unicode text.


Files

Actions

Also available in: Atom PDF