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

Bug: insensitive like query failing with multibyte characters #9236

Closed
ECode16 opened this issue Oct 25, 2024 · 2 comments · Fixed by #9238
Closed

Bug: insensitive like query failing with multibyte characters #9236

ECode16 opened this issue Oct 25, 2024 · 2 comments · Fixed by #9238
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@ECode16
Copy link

ECode16 commented Oct 25, 2024

PHP Version

7.4

CodeIgniter4 Version

4.4.8

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

cli

Database

Postgres 16

What happened?

strtolower() in BaseBuilder.php on line 1135 will ignore the multibyte characters (according to PHP8 docs) or in experience on 7.4 will mangle them into diamonds (�).

Steps to Reproduce

$query->like('name', 'Š', 'both', null, true)->find();

Expected Output

all rows where name contains š

Actual Output

ErrorException: pg_query(): Query failed: ERROR: invalid byte sequence for encoding "UTF8": 0xe5 0xa1 0x27 in C:....

Anything else?

No response

@ECode16 ECode16 added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 25, 2024
@michalsn
Copy link
Member

@ECode16 Can you check if #9238 fixes it for you?

@ECode16
Copy link
Author

ECode16 commented Oct 26, 2024

@michalsn Yes, it does.

@ECode16 ECode16 closed this as completed Oct 26, 2024
@ddevsr ddevsr reopened this Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
3 participants