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

Handle Unicode character in project generation #1328

Closed
snicoll opened this issue Sep 5, 2022 · 8 comments
Closed

Handle Unicode character in project generation #1328

snicoll opened this issue Sep 5, 2022 · 8 comments

Comments

@snicoll
Copy link
Contributor

snicoll commented Sep 5, 2022

See spring-io/start.spring.io#990

I don't know how easy it would be to map the characters to something that would work but it's certainly worth researching. Or we could chose to fail upfront, rather than failing later as we do now.

@wilkinsona
Copy link
Contributor

wilkinsona commented Sep 6, 2022

The Normalizer-based technique described in https://www.baeldung.com/java-remove-accents-from-text could help here.

@okan35
Copy link

okan35 commented Sep 12, 2022

Hello, if noone is working on this I could take it as a first timer contribution.

@snicoll
Copy link
Contributor Author

snicoll commented Sep 13, 2022

The issue is yours @okan35. Thank you very much and let us know if you have any question.

@okan35
Copy link

okan35 commented Sep 19, 2022

Hello, so basically I am trying to run the initializr-generator just so that at least I can the api for generation but I haven't been successful.

What I have tried so far is doing ./mvnw clean install and then in initializr-generator/target directory do java -jar initializr-generator-0.13.0-SNAPSHOT.jar but this always gives me no main manifest attribute, in C:/Users/pc/Desktop/okan/spring initializr/initializr/initializr-generator/target/initializr-generator-0.13.0-SNAPSHOT.jar
Do you have any suggestions regarding how I can get generator to work as I have also added just the generator in a new project like it is said in documentation but that also hasn't been successful.

So I just need to be able make it work basically, what would you suggest regarding this ?

By the way I was able to start.spring.io even though I could not get the UI strangely.

@snicoll
Copy link
Contributor Author

snicoll commented Sep 20, 2022

@okan35 thanks for the feedback. There are a number of tests in initializr-web, including HTTP-based tests that you can improve to validate that unicode characters are handled properly. initializr-generator is a "simple" java library, not an app.

If you want to play around with curl against the service, you can give initializr-service-sample in this repository a try maybe?

@okan35
Copy link

okan35 commented Sep 24, 2022

So basically I should not be providing a fix but just add an additional test in initializr-web ?

Also I used normalizer basically in ProjectRequest class as I believe that is the entrypoint for user's settings.

I used it as below I believe that is kind of it since I could not really run the whole initializr web UI to generate a project.

public String getName() { return Normalizer.normalize(this.name,Normalizer.Form.NFKD); }

public void setName(String name) { this.name = Normalizer.normalize(name,Normalizer.Form.NFKD); }

nirbhay24 added a commit to nirbhay24/initializr that referenced this issue Nov 20, 2022
@nirbhay24
Copy link
Contributor

@snicoll I have added a commit, with Idea that we should sanitize input, and convert accents character to normal char.
And have raised a PR for same let me know if it looks fine.

@snicoll
Copy link
Contributor Author

snicoll commented Nov 24, 2022

Closing in favor of PR #1345

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2022
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

4 participants