qrilka / xlsx

Simple and incomplete Excel file parser/writer
MIT License
128 stars 62 forks source link

Strip leading slash from logical names #172

Closed luke-clifton closed 6 months ago

luke-clifton commented 6 months ago

According to part 2, section 7.3.4 of ECMA-376, when mapping logical item names to ZIP item names we need to remove the leading slash.

http://www.ecma-international.org/publications/standards/Ecma-376.htm

luke-clifton commented 6 months ago

I notice that document also says that we should percent encode non-ASCII.

In order to properly do that, I'd have to confirm which encoding the FilePath being returned is using. That is going to involve a bit of digging.

luke-clifton commented 6 months ago

Ah, digging went quickly.

https://github.com/qrilka/xlsx/blob/426eb0ad3aa6686cfdff309d87a2428df0011f83/src/Codec/Xlsx/Types/Internal/Relationships.hs#L118

It seems this FilePath is not using the file system encoding (i.e., it's a String, not a FilePath).

I'm now trying to find the exact definition of percent encoding in this context, but my internet has decided that 3kb/s is as fast as things are going today :(

qrilka commented 6 months ago

@luke-clifton I'd skip percent-encoding at least until we find it used for Excel files, mentioning that in a comment would be enough

qrilka commented 6 months ago

Closes #171

luke-clifton commented 6 months ago

I think this is ready.

qrilka commented 6 months ago

Great, thanks @luke-clifton ! I'll fix the link in the cabal file and will push 1.1.2 a bit later

qrilka commented 6 months ago

It took me a while but 1.1.2 is on Hackage