Skip to content

implement escaping of %% to \% #4

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lutzifer
Copy link
Member

No description provided.

@Lutzifer Lutzifer requested review from emuguy1, msuess23 and Copilot May 20, 2025 08:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for escaping literal percent signs in the conversion pipeline.

  • Introduces .replacingOccurrences(of: "%%", with: "\\%") to map %% to \%
  • Ensures percent signs are handled alongside other format specifiers
Files not reviewed (3)
  • Tests/StringCatalogConverterLibraryTests/Resources/SimpleTest/Input.xcstrings: Language not supported
  • Tests/StringCatalogConverterLibraryTests/Resources/SimpleTest/Output.de.xml: Language not supported
  • Tests/StringCatalogConverterLibraryTests/Resources/SimpleTest/Output.en.xml: Language not supported
Comments suppressed due to low confidence (1)

Sources/StringCatalogConverterLibrary/StringCatalog+Conversion.swift:18

  • Add unit tests to cover this new escaping behavior for %% to ensure the conversion outputs \% as expected.
.replacingOccurrences(of: "%%", with: "\\%") // https://stackoverflow.com/a/74864023

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.

3 participants