You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

5
4
6
5
Project homepage: <http://idnaconv.net><br>
7
6
by Matthias Sommerfeld <matthias.sommerfeld@algo26.de><br>
@@ -21,7 +20,7 @@ for details) as they can be used with various registries worldwide to be transla
21
20
The library provides two classes (`ToIdn` and `ToUnicode` respectively), which expose three public methods to convert between the respective forms. See the Example section below.
22
21
This allows you to convert host names (simple labels like `localhost` or FQHNs like `some-host.domain.example`), email addresses and complete URLs.
23
22
24
-
Errors, incorrectly encoded or invalid strings will lead to various exceptions. They should help you to find out, what went wrong.
23
+
Errors, incorrectly encoded or invalid strings will lead to various exceptions. They should help you find out, what went wrong.
25
24
26
25
Unicode strings are expected to be UTF-8 strings. ACE strings (the Punycode form) are always 7bit ASCII strings.
The official ZIP packages are discontinued. Stick to Composer or Github to acquire your copy, please.
37
+
The official ZIP packages are discontinued. Stick to Composer or GitHub to acquire your copy, please.
39
38
40
39
## Upgrading from a previous version
41
40
@@ -85,7 +84,7 @@ echo utf8_decode($output); // This will read: andre@börse.knörz.info
85
84
86
85
### Example 3.
87
86
88
-
The input is read from a UCS-4 coded file and encoded line by line. By appending the optional second parameter we tell enode() about the input format to be used
87
+
The input is read from a UCS-4 coded file and encoded line by line. By appending the optional second parameter we tell encode() about the input format to be used
89
88
90
89
```php
91
90
<?php
@@ -132,29 +131,29 @@ Per default, the class converts strings according to IDNA version 2008. To suppo
132
131
// Include the class
133
132
use Algo26\IdnaConvert\ToIdn;
134
133
// Instantiate it, switching to IDNA 2003, the original, now outdated standard
135
-
$IDN = new ToIdn(2008);
136
-
// Sth. containing the German letter ß
134
+
$IDN = new ToIdn(2003);
135
+
// Something containing the German letter ß
137
136
$input = 'meine-straße.example';
138
-
// Encode it to its punycode presentation
137
+
// Encode it to its punycode representation
139
138
$output = $IDN->convert($input);
140
-
// Output, what we got now
139
+
// Output what we got now
141
140
echo $output; // xn--meine-strae-46a.example
142
141
143
142
// Switch back to IDNA 2008
144
-
$IDN = new ToIdn(2003);
145
-
// Sth. containing the German letter ß
143
+
$IDN = new ToIdn(2008);
144
+
// Something containing the German letter ß
146
145
$input = 'meine-straße.example';
147
-
// Encode it to its punycode presentation
146
+
// Encode it to its punycode representation
148
147
$output = $IDN->convert($input);
149
-
// Output, what we got now
148
+
// Output what we got now
150
149
echo $output; // meine-strasse.example
151
150
```
152
151
153
152
154
153
## Encoding helper
155
154
156
155
In case you have strings in encodings other than ISO-8859-1 and UTF-8 you might need to translate these strings to UTF-8 before feeding the IDNA converter with it.
157
-
PHP's builtin functions `utf8_encode()` and `utf8_decode()` can only deal with ISO-8859-1.
156
+
PHP's built-in functions `utf8_encode()` and `utf8_decode()` can only deal with ISO-8859-1.
158
157
Use the encoding helper class supplied with this package for the conversion. It requires either iconv, libiconv or mbstring installed together with one of the relevant PHP extensions. The functions you will find useful are
159
158
`toUtf8()` as a replacement for `utf8_encode()` and
160
159
`fromUtf8()` as a replacement for `utf8_decode()`.
@@ -209,7 +208,7 @@ Please use the [issues tab on GitHub](https://github.com/algo26-matthias/idna-co
209
208
210
209
## Contact the author
211
210
212
-
For questions, bug reports and security issues just send me an email.
211
+
For questions, bug reports and security issues just drop me a line.
Copy file name to clipboardExpand all lines: include/vendor/algo26-matthias/idna-convert/UPGRADING.md
+29-13Lines changed: 29 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,25 @@
1
1
# Upgrading from previous versions
2
2
3
-
## 3.0
3
+
## 3.2.0
4
+
5
+
The extra dependency to ext/intl, accidentally introduced with v 3.1 is no longer required.
6
+
7
+
8
+
## 3.1.0
9
+
10
+
We changed the behaviour of the Punycode algorithm to now include all basic ASCII characters in the output when using `ToPunycode->convert()`.
11
+
This change is expected to have no negative effect, but work more closely to the respective RFCs. The old behaviour even led to some endless loops for a few Unicode characters.
12
+
13
+
14
+
## 3.0.0
4
15
5
16
The library has been broken down into various specific classes, thus more closely following SOLID principles.
6
17
7
18
As such the single class `IdnaConvert` has been broken down into `ToIdn` and `ToUnicode` respectively. Their naming reflects
8
-
the format of the outcome, so it's more clear to distinguish, what you need. This should be easier to grasp then the old method names `encode()` and `decode()`.
19
+
the format of the outcome, so it's easier picking the right conversion direction.
9
20
Usually you will only need one conversion direction per script run, so why bother loading and parsing all the other unused code, then?
10
21
11
-
Also the handling of host names (simple labels like `my-hostname` or FQHNs like `some-host.my-domain.example`) is now separated from
22
+
Also, the handling of host names (simple labels like `my-hostname` or FQHNs like `some-host.my-domain.example`) is now separated from
12
23
that of email addresses and URLs.
13
24
Both classes offer the same set of public methods:
14
25
@@ -19,41 +30,46 @@ Both classes offer the same set of public methods:
19
30
|`convertUrl()`| To convert the host name of an URL |
20
31
21
32
There's no "strict mode" anymore, this is achieved by the separate methods above. The IDN version is selected when instantiating the class, no more setting during runtime.
22
-
Also the encoding (for the Unicode side of things) is now **always UTF-8**. Use `TransCodeUnicode` or `EncodingHelper` for converting to and from various encodings to UTF-8.
33
+
Also, the encoding (for the Unicode side of things) is now **always UTF-8**. Use `TransCodeUnicode` or `EncodingHelper` for converting to and from various encodings to UTF-8.
23
34
24
-
All actual sub classes like that for NamePrep and the actual Punycode transformation are put in their own namespaces under `Algo26\IdnaConvert`, e.g. `Algo26\IdnaConvert\NamePrep`.
25
-
Interfaces and Exceptions also have their own namespace to declutter the class structure even more.
35
+
All actual subclasses like that for NamePrep and the actual Punycode transformation are put in their own namespaces under `Algo26\IdnaConvert`, e.g. `Algo26\IdnaConvert\NamePrep`.
36
+
Interfaces and Exceptions also have their own namespace to declutter the class structure even more.
26
37
27
38
The class `EncodingHelper` is now called separated into the two classes `ToUtf8` and `FromUtf8` respectively and lies under the namespace `Algo26\idnaConvert\EncodingHelper`.
28
39
The class `UnicodeTranscoder` is now called `TransCodeUnicode` under the namespace `Algo26\idnaConvert\TransCodeUnicode`.
29
40
30
41
All examples are updated to reflect the new usage. See the ReadMe for more details.
31
42
32
-
Also the **minimum PHP version is now 7.2**.
43
+
Finally, the **minimum PHP version is now 7.2**.
33
44
34
-
## 2.0
35
-
The library has been handed over to actively maintained GitHub and Packagist accounts. This lead to a change in the namespace.
45
+
46
+
## 2.0.0
47
+
The library has been handed over to actively maintained GitHub and Packagist accounts. This led to a change in the namespace.
36
48
Replace all occurrences of
37
49
`Mso\IdnaConvert` or `PhlyLabs\IdnaConvert` to `Algo26\IdnaConvert`.
38
50
There's no further changes to the class signatures.
39
51
40
-
## 1.0
52
+
53
+
## 1.0.0
41
54
**BC break:**
42
55
As of version 1.0.0 the class closely follows the PSRs PSR-1, PSR-2 and PSR-4 of the PHP-FIG.
43
56
As such the classes' naming has been changed, a namespace has been introduced and the default IDN version has changed from 2003 to 2008 and minimum PHP engine version raised to 5.6.0.
44
57
58
+
45
59
## 0.8.0
46
60
As of version 0.8.0 the class fully supports IDNA 2008.
47
-
Thus the aforementioned parameter is deprecated and replaced by a parameter to switch between the standards. See the updated example 5 in the ReadMe.
61
+
Thus, the aforementioned parameter is deprecated and replaced by a parameter to switch between the standards. See the updated example 5 in the ReadMe.
62
+
48
63
49
64
## 0.6.4
50
65
**BC break:**
51
66
As of version 0.6.4 the class per default allows the German ligature ß to be encoded as the DeNIC, the registry for .DE allows domains containing ß.
52
67
68
+
53
69
## 0.6.0
54
70
**ATTENTION:** As of version 0.6.0 this class is written in the OOP style of PHP 5.
55
-
Since PHP 4 is no longer actively maintained, you should switch to PHP 5 as fast as possible.
56
-
We expect to see no compatibility issues with the upcoming PHP 6, too.
71
+
Since PHP 4 is no longer actively maintained, you should switch to PHP 5 as quickly as possible.
72
+
We expect no compatibility issues with the upcoming ~~PHP 6~~ PHP 7 as well.
0 commit comments