Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip leading slash from logical names #172

Merged
merged 1 commit into from
Jan 14, 2024

Conversation

luke-clifton
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor Author

Ah, digging went quickly.

trg <- T.unpack <$> attribute "Target" cur

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
Copy link
Owner

qrilka commented Jan 13, 2024

@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
Copy link
Owner

qrilka commented Jan 13, 2024

Closes #171

-- 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>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link looks to be outdated - it returns 404 for me.
The new Url appears to be https://ecma-international.org/publications-and-standards/standards/ecma-376/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, sorry.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np, I guess I should also update the link in cabal

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
Copy link
Contributor Author

I think this is ready.

@qrilka qrilka merged commit d9ea2d5 into qrilka:master Jan 14, 2024
5 checks passed
@qrilka
Copy link
Owner

qrilka commented Jan 14, 2024

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

@qrilka
Copy link
Owner

qrilka commented Jan 16, 2024

It took me a while but 1.1.2 is on Hackage

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.

2 participants