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

Remove hard coded charset. #17826

Merged
merged 1 commit into from
Jul 14, 2020
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Removes charset information from the strip_phone_numeric function

Before

CHARSET hard-coded to utf8 - which opens the 'utf8mb4 question

After

No hard-coding. I believe it's not required

Technical Details

In thinking about the proposal here
https://github.com/civicrm/civicrm-core/pull/13633/files#diff-c5e39924ad99ac88b48763a0d8fa246eR30
to switch to utf8mb4 I found that none of the places on the web that suggest functions like ours
specifiy charset - eg. https://stackoverflow.com/questions/287105/mysql-strip-non-numeric-characters-to-compare

When I look at the code it is iterating through the characters to find integers - which should
be the same regardless of charset. So, I think we can simply remove it.

Comments

In thinking about the proposal here
https://github.com/civicrm/civicrm-core/pull/13633/files#diff-c5e39924ad99ac88b48763a0d8fa246eR30
to switch to utf8mb4 I found that none of the places on the web that suggest functions like ours
specifiy charset - eg. https://stackoverflow.com/questions/287105/mysql-strip-non-numeric-characters-to-compare

When I look at the code it is iterating through the characters to find integers - which should
be the same regardless of charset. So, I think we can simply remove it.
:
@civibot
Copy link

civibot bot commented Jul 14, 2020

(Standard links)

@civibot civibot bot added the master label Jul 14, 2020
@colemanw
Copy link
Member

Tests pass and I'm happy to follow the recommendation on SE for this one.

@colemanw colemanw merged commit 8ab2988 into civicrm:master Jul 14, 2020
@colemanw colemanw deleted the less_utf branch July 14, 2020 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants