jeremykendall / php-domain-parser

Public Suffix List based domain parsing implemented in PHP
MIT License
1.16k stars 128 forks source link

Fix UTF-8 characters convertation #221

Closed MaksymPerehinka closed 6 years ago

MaksymPerehinka commented 6 years ago

Introduction

Before this PR, when trying to parse some domains with hieroglyphs, the IDN to ASCII converter returned false, when tried to convert those domains, or converted them wrong, and as a result, Public Suffix List rules couldn't be converted to JSON and saved.

Proposal

I propose to change strtolower() in IDNAConverterTrait to mb_strtolower() to convert domains to lowercase properly.

Describe the new/upated/fixed feature

Changed strtolower() to mb_strtolower() in method idnToAscii() of IDNAConverterTrait

Targeted release version

Version 5.2.0

nyamsprod commented 6 years ago

@MaksymPerehinka Thanks for the proposal but did you try the develop branch where this issue has already been fixed. After a review period the develop branch will be merge in the master branch and tagged.

For what is worth this issue was already reported in issue #219

MaksymPerehinka commented 6 years ago

@nyamsprod sorry, didn't notised that issue