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

URL encoding for specialcharcters won'r work. #419

Closed
roottr opened this Issue Oct 13, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@roottr

roottr commented Oct 13, 2017

Hello,

It seems Lobster won't correctly encode URl for special characters.

For example:

shows as > s/xociqc/tesla_11_bin_adet_model_x_arac_n_geri_r_yor

should be > s/xociqc/tesla_11_bin_adet_model_x_aracini_geri_cagriyor

Would you know how to fix this?

Thanks a lot in advance.

@pushcx

This comment has been minimized.

Show comment
Hide comment
@pushcx

pushcx Oct 13, 2017

Member

This isn't a bug to be fixed. Not every character is valid in a URL and Story#title_as_url reflects this with the gsub a few lines down: gsub(/[^a-z0-9]/, "_"). If you'd rather leave out the non-ascii characters, replace the "_" with "".

Member

pushcx commented Oct 13, 2017

This isn't a bug to be fixed. Not every character is valid in a URL and Story#title_as_url reflects this with the gsub a few lines down: gsub(/[^a-z0-9]/, "_"). If you'd rather leave out the non-ascii characters, replace the "_" with "".

@pushcx pushcx closed this Oct 13, 2017

@pushcx pushcx added the question label Oct 13, 2017

@roottr

This comment has been minimized.

Show comment
Hide comment
@roottr

roottr Oct 14, 2017

Hi @pushcx thanks a lot for your response. Would you know also how I can encode turkish character such as title "başakı" to "basaki" ?

Thank you very much in advance.

roottr commented Oct 14, 2017

Hi @pushcx thanks a lot for your response. Would you know also how I can encode turkish character such as title "başakı" to "basaki" ?

Thank you very much in advance.

@pushcx

This comment has been minimized.

Show comment
Hide comment
@pushcx

pushcx Oct 15, 2017

Member

It looks like parameterize does this.

This could replace the downcase and maybe some of the use of gsub in title_as_url. I'm reopening this issue, it would be a nice small feature. If you use this on your site, please open a pull request so the main Lobsters code can include it. (If you don't in a week or two, anyone reading this should feel free to do this and I've added the good first issue label.)

Member

pushcx commented Oct 15, 2017

It looks like parameterize does this.

This could replace the downcase and maybe some of the use of gsub in title_as_url. I'm reopening this issue, it would be a nice small feature. If you use this on your site, please open a pull request so the main Lobsters code can include it. (If you don't in a week or two, anyone reading this should feel free to do this and I've added the good first issue label.)

@pushcx pushcx reopened this Oct 15, 2017

@pushcx pushcx closed this in #448 Jan 30, 2018

pushcx added a commit that referenced this issue Jan 30, 2018

Use parameterize in title_as_url
Use the Rails feature for this cleanup to catch more corner cases.

Fixes #419

mtnygard added a commit to mtnygard/lobsters that referenced this issue Jan 30, 2018

Use parameterize in title_as_url
Use the Rails feature for this cleanup to catch more corner cases.

Fixes #419
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment