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

[Bug] assembly-informational-format doesn't support special or international characters #2339

Closed
LazaroOnline opened this issue Jun 24, 2020 · 4 comments

Comments

@LazaroOnline
Copy link
Contributor

The assembly-informational-format doesn't support special or international characters.

Expected Behavior

Product version should just be the text from the template as-is, without replacing special characters, allowing things like:
Some special characters: +-=#![]^&@$%:<>//\\-çñáÁ统

*If there is any particular scenario that has problems with letting special characters in that attribute then I would like to have a configuration parameter to enable/disable special character replacement, but if there is no such case then just keep them and don't replace them.

Actual Behavior

It replaces special characters and international unicode characters by a dash "-".
Using this config: assembly-informational-format: 'Some special characters: +-=#![]^&@$%:<>//\\-çñáÁ统'
Results in:
Product version: Some-special-characters--+------------------------
Losing all information from special chars.

Steps to Reproduce

Create a dotnet project, add GitVersion.Task NuGet and add a GitVersion.yml config (UTF-8 encoded) file with the following text:

assembly-informational-format: 'Some special characters: +-=#![]^&@$%:<>//\\-çñáÁ统'

DotNet does allow any free unicode text

You can confirm that it is not a dotnet limitation by adding special characters to the attribute:
For Full dotnet, in AssemblyInfo.cs:

[assembly: AssemblyInformationalVersion("Some special characters: +-=#![]^&@$%:<>//\\-çñáÁ统")]

Results in: Some special characters: +-=#![]^&@$%:<>//\-çñáÁ统 as expected.

For dotnet Core, in the csproj file:

<InformationalVersion>Some special characters: +-=#![]^@$%://\\-çñáÁ统</InformationalVersion>

Results in: Some special characters: +-=#![]^@$%://\\-çñáÁ统 as expected.

Context

We need to add custom free text version information to the assembly, like:
"demo to customer: Nestlé"
it can have any special character and it should be preserved.

Your Environment

  • Tested with dotnet 4.8 and dotnet core 3.1, same thing occurs in both.
  • Version Used: GitVersionTask 5.3.6
  • Operating System and version Windows 10
@LazaroOnline LazaroOnline changed the title [Bug] [Bug] assembly-informational-format doesn't support special or international characters Jun 24, 2020
@LazaroOnline
Copy link
Contributor Author

Related to:
#2199

@asbjornu
Copy link
Member

asbjornu commented Mar 8, 2022

I think one viable take on this is to be able to configure the branch name replacement regex as discussed in #1674.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Apr 13, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants