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

Generate real Unicode URL #40

Closed
dorajistyle opened this issue Jan 25, 2012 · 4 comments
Closed

Generate real Unicode URL #40

dorajistyle opened this issue Jan 25, 2012 · 4 comments

Comments

@dorajistyle
Copy link

Hello,
Thank you for create very nice module.
When I read a document, I found the example below.
"tell your readers 你好".to_url => "tell-your-readers-ni-hao"

Could I make a slug as real Unicode likes below one?

"tell your readers 你好 bla".to_url => "tell-your-readers-你好-bla"

Have a nice day!

@rsl
Copy link
Owner

rsl commented Feb 16, 2012

that would be hard to do via stringex because it would basically be ignoring changing the unicode to ascii. have you tried Rails' String#parameterize? not sure other than a plain gsub on whitespacey chars what else to use there. sorry.

@dorajistyle
Copy link
Author

Hi rsl. Thank you for the reply.
I tried String#parameterize? But it's not working well. Anybody have a good idea? :D

@rsl
Copy link
Owner

rsl commented Feb 20, 2012

sorry. not really. you could write yr own one that just transforms spaces and some other illegal chars i guess. i've got my hands full right now but i imagine something in stringex that could bypass converting unicode [and just handles the illegal chars] would be useful. wanna take a stab and i'll check it out?

@dorajistyle
Copy link
Author

Now I've got my hands, too. Thank you for the suggestion. When I can start about it, I will reopen this issue.

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

No branches or pull requests

2 participants