Skip to content

swift 6 cannot open correctly a windowsCP1252 file in linux (worked on swift 5 and macos) #1216

Closed
@Dracks

Description

@Dracks

Description

Opening a file that is an export of transactions from an spanish bank (Caixa enginyers) which is an xls (html+latin1252) it gives a bad format using swift 6 compiler in linux. In mac-os or using swift 5.10 compiler works fine

Reproduction

Download the sample file:
https://github.com/Dracks/mr-scrooge/blob/mr-scrooge-3.0.0/src/swift-server-tests/test_files/MovimientosCuenta.xls

	guard let fileData = FileManager.default.contents(atPath: filePath)
				else {
					return
				}
				guard let fileString = String(data: fileData, encoding: .windowsCP1252)
				else {
					return
				}

Expected behavior

get's the contents of the file in fileString variable. (Now the second ward execute the else case)

Environment

Swift version 6.0.2 (swift-6.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional information

The link is a sample file exported from my bank, and anonymized, that I've got to run tests of my app. But today I expecuted it on my machine using the original file downloaded from the bank account and the same happened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions