Skip to content

Commit

Permalink
Specify encoding (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed authored Oct 4, 2024
1 parent 43a838e commit 0774c74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/SafeDITool/SafeDITool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct SafeDITool: AsyncParsableCommand, Sendable {
) { taskGroup in
taskGroup.addTask {
if let swiftSourcesFilePath {
try String(contentsOfFile: swiftSourcesFilePath)
try String(contentsOfFile: swiftSourcesFilePath, encoding: .utf8)
.components(separatedBy: CharacterSet(arrayLiteral: ","))
.removingEmpty()
} else {
Expand Down Expand Up @@ -166,7 +166,7 @@ struct SafeDITool: AsyncParsableCommand, Sendable {
for filePath in try await findSwiftFiles() {
guard !filePath.isEmpty else { continue }
taskGroup.addTask {
let swiftFile = try String(contentsOfFile: filePath)
let swiftFile = try String(contentsOfFile: filePath, encoding: .utf8)
if swiftFile.contains("@\(InstantiableVisitor.macroName)") {
return swiftFile
} else {
Expand Down Expand Up @@ -212,7 +212,7 @@ struct SafeDITool: AsyncParsableCommand, Sendable {
get throws {
if let dependentModuleInfoFilePath {
try .init(
String(contentsOfFile: dependentModuleInfoFilePath)
String(contentsOfFile: dependentModuleInfoFilePath, encoding: .utf8)
.components(separatedBy: CharacterSet(arrayLiteral: ","))
.removingEmpty()
.map(\.asFileURL)
Expand Down

0 comments on commit 0774c74

Please sign in to comment.