summaryrefslogtreecommitdiff
path: root/ext/intl
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-04-14 13:56:48 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-04-14 15:30:01 +0200
commit04ab4d09bef7c0c6c1664d5665c0b8cce3cca89b (patch)
tree25c8e549fed479bb893546f9aebfc7d35153b171 /ext/intl
parent1f48feebb9be61cfd613f8fc62af87fa53bc741b (diff)
downloadphp-git-04ab4d09bef7c0c6c1664d5665c0b8cce3cca89b.tar.gz
Add Intl resource bundle files for big-endian architecture.
Little and Big endian files have their own designated folder. Both use the ASCII charset family. We may want to add a big-endian/EBCDIC charset family resource bundle in the future. The build script is currently left untouched as it seems to mostly be for Windows.
Diffstat (limited to 'ext/intl')
-rw-r--r--ext/intl/tests/_files/resourcebundle_be/es.resbin0 -> 384 bytes
-rw-r--r--ext/intl/tests/_files/resourcebundle_be/res_index.resbin0 -> 128 bytes
-rw-r--r--ext/intl/tests/_files/resourcebundle_be/root.resbin0 -> 400 bytes
-rw-r--r--ext/intl/tests/_files/resourcebundle_le/es.res (renamed from ext/intl/tests/_files/resourcebundle/es.res)bin384 -> 384 bytes
-rw-r--r--ext/intl/tests/_files/resourcebundle_le/res_index.res (renamed from ext/intl/tests/_files/resourcebundle/res_index.res)bin128 -> 128 bytes
-rw-r--r--ext/intl/tests/_files/resourcebundle_le/root.res (renamed from ext/intl/tests/_files/resourcebundle/root.res)bin388 -> 400 bytes
-rw-r--r--ext/intl/tests/resourcebundle.build1
-rw-r--r--ext/intl/tests/resourcebundle.inc10
8 files changed, 10 insertions, 1 deletions
diff --git a/ext/intl/tests/_files/resourcebundle_be/es.res b/ext/intl/tests/_files/resourcebundle_be/es.res
new file mode 100644
index 0000000000..5564e199ce
--- /dev/null
+++ b/ext/intl/tests/_files/resourcebundle_be/es.res
Binary files differ
diff --git a/ext/intl/tests/_files/resourcebundle_be/res_index.res b/ext/intl/tests/_files/resourcebundle_be/res_index.res
new file mode 100644
index 0000000000..03892a6afb
--- /dev/null
+++ b/ext/intl/tests/_files/resourcebundle_be/res_index.res
Binary files differ
diff --git a/ext/intl/tests/_files/resourcebundle_be/root.res b/ext/intl/tests/_files/resourcebundle_be/root.res
new file mode 100644
index 0000000000..7df81bc0db
--- /dev/null
+++ b/ext/intl/tests/_files/resourcebundle_be/root.res
Binary files differ
diff --git a/ext/intl/tests/_files/resourcebundle/es.res b/ext/intl/tests/_files/resourcebundle_le/es.res
index f9d891d6ba..f9d891d6ba 100644
--- a/ext/intl/tests/_files/resourcebundle/es.res
+++ b/ext/intl/tests/_files/resourcebundle_le/es.res
Binary files differ
diff --git a/ext/intl/tests/_files/resourcebundle/res_index.res b/ext/intl/tests/_files/resourcebundle_le/res_index.res
index 9dd3df2de3..9dd3df2de3 100644
--- a/ext/intl/tests/_files/resourcebundle/res_index.res
+++ b/ext/intl/tests/_files/resourcebundle_le/res_index.res
Binary files differ
diff --git a/ext/intl/tests/_files/resourcebundle/root.res b/ext/intl/tests/_files/resourcebundle_le/root.res
index 62cb48c457..52cd79e002 100644
--- a/ext/intl/tests/_files/resourcebundle/root.res
+++ b/ext/intl/tests/_files/resourcebundle_le/root.res
Binary files differ
diff --git a/ext/intl/tests/resourcebundle.build b/ext/intl/tests/resourcebundle.build
index 273e4407b7..ee645a0c55 100644
--- a/ext/intl/tests/resourcebundle.build
+++ b/ext/intl/tests/resourcebundle.build
@@ -1,4 +1,5 @@
<?php
+// FIXME Add handling for big endian archs
// THIS SCRIPT WILL REBUILD ResourceBundle bundles from source files
// DEFINE YOUR ICU TOOLS PATH HERE
diff --git a/ext/intl/tests/resourcebundle.inc b/ext/intl/tests/resourcebundle.inc
index 9eea8aaffb..614a740333 100644
--- a/ext/intl/tests/resourcebundle.inc
+++ b/ext/intl/tests/resourcebundle.inc
@@ -1,5 +1,13 @@
<?php
-define('BUNDLE', dirname(__FILE__)."/_files/resourcebundle");
+// FIXME Improve Endian check when endian const gets added
+// Check if platform is Big or Little endian
+if (pack('S', 0xABCD) !== pack('v', 0xABCD)) {
+ $endian = 'be';
+} else {
+ $endian = 'le';
+}
+
+define('BUNDLE', __DIR__ . '/_files/resourcebundle_' . $endian);
function debug( $res ) {
if (is_null( $res )) {