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

Issue with another complex file name #30

Merged
merged 2 commits into from
Nov 9, 2016

Conversation

robbiecooray
Copy link
Contributor

Resource naming seem to prefix any number that follows a dot with an underscore. The last change, although worked for some use cases, did not work for another specific case:
hammer.js-1.0.10

  • this basically should transforms to:
    hammer**.**js-1._0._10
  • my initial commit converts it to:
    hammer**._**js-1._0._10

@mcintyre321 mcintyre321 merged commit 41312fe into mcintyre321:master Nov 9, 2016
@mcintyre321
Copy link
Owner

mcintyre321 commented Nov 9, 2016

Thanks again. just found this:

If the key parameter is an empty string (""), a string that consists of a single underscore character (_) is returned. If the key parameter is not an empty string, the VerifyResourceName method compares each character in the string to a set of invalid tokens based on the language specified by the provider parameter. Any invalid character in the string is replaced with an underscore character. The characters that will be replaced with an underscore are as follows:

' ' (space), U+00A0 (non-breaking space), '.' (period), ',' (comma), ';' (semicolon), '|', '~', '@', '#', '%', '^', '&', '*', '+', '-', '/', '', '<', '>', '?', '[', ']', '(', ')', '{', '}', '"' (quote), ''' (apostrophe), ':', and '!'.

Note
Strongly-typed resources do not allow the use of language keywords (such as if, for, and so on) as resource key names. However, the System.CodeDom design pattern allows the use of language keywords by prefixing the keyword with the underscore character. The VerifyResourceName method calls the CreateValidIdentifier method to enforce this design. For example, if you use a resource name that is the same as a language keyword, such as for, the name appears as _for in the generated strongly-typed resource class.

from http://stackoverflow.com/questions/14705211/how-is-net-renaming-my-embedded-resources

@robbiecooray
Copy link
Contributor Author

Good find!

On Wed, Nov 9, 2016, 9:28 PM Harry McIntyre notifications@github.com
wrote:

Thanks again. just found this:

If the key parameter is an empty string (""), a string that consists of a
single underscore character (_) is returned. If the key parameter is not an
empty string, the VerifyResourceName method compares each character in the
string to a set of invalid tokens based on the language specified by the
provider parameter. Any invalid character in the string is replaced with an
underscore character. The characters that will be replaced with an
underscore are as follows:

' ' (space), U+00A0 (non-breaking space), '.' (period), ',' (comma), ';'
(semicolon), '|', '~', '@', '#', '%', '^', '&', '*', '+', '-', '/', '',
'<', '>', '?', '[', ']', '(', ')', '{', '}', '"' (quote), ''' (apostrophe),
':', and '!'.

Note
Strongly-typed resources do not allow the use of language keywords (such
as if, for, and so on) as resource key names. However, the System.CodeDom
design pattern allows the use of language keywords by prefixing the keyword
with the underscore character. The VerifyResourceName method calls the
CreateValidIdentifier method to enforce this design. For example, if you
use a resource name that is the same as a language keyword, such as for,
the name appears as _for in the generated strongly-typed resource class.

from
http://stackoverflow.com/questions/14705211/how-is-net-renaming-my-embedded-resources

So even language keywords are escaped!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQxCM1vVxK4fKPpjzMMWNg922Sjm_nS8ks5q8aBCgaJpZM4Ks9YE
.

@mcintyre321
Copy link
Owner

Actually I think that may be the wrong thing - thats about how ResGen maps resource names into c# :(

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.

None yet

2 participants