aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-03-12 20:54:55 -0700
committerzotlabs <mike@macgirvin.com>2018-03-12 20:54:55 -0700
commitab1d47b36f21e5881900d9d805f4f7876f1c472f (patch)
tree5d0de385738ebb2fc332b38ff4a59f0cf4f1ca68 /include/text.php
parent34399b8b47d9a85eb3c4095392ab994792257d88 (diff)
downloadvolse-hubzilla-ab1d47b36f21e5881900d9d805f4f7876f1c472f.tar.gz
volse-hubzilla-ab1d47b36f21e5881900d9d805f4f7876f1c472f.tar.bz2
volse-hubzilla-ab1d47b36f21e5881900d9d805f4f7876f1c472f.zip
unicode/emoji usernames. Warning: experimental feature, unstable, untested, disabled by default, use at your own risk, may not federate to other platforms and protocols. May not clone correctly. Bug reports which neglect to include detailed roubleshooting information and patches/pull requests will be ignored.
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index 6675043e6..c1e064857 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3318,3 +3318,19 @@ function featured_sort($a,$b) {
$s2 = substr($b,strpos($b,'id='),20);
return(strcmp($s1,$s2));
}
+
+
+function punify($s) {
+ require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
+ $x = new idna_convert(['encoding' => 'utf8']);
+ return $x->encode($s);
+
+}
+
+function unpunify($s) {
+ require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
+ $x = new idna_convert(['encoding' => 'utf8']);
+ return $x->decode($s);
+
+}
+