Page 1 of 1

Latin to specialchar table: de- and encrypt stylized names

Posted: 30 Mar 2016, 16:22
by askuri
I collected all specialchars aining a latin one in a table. This is useful in to ways:
  • Players can more easily "encrypt" their name, because they do not have to search for fitting specialchars
  • Programmers can implement a function to their software, which makes it possible to search for encrypted name. At the moment no one ever finds a map by a search function, if it mainly consists of specialchars. Using str_replace (which supports arrays), you can decrypt it into latin chars. E.g. my nickname "λsκμяι" which can't be found easily would turn into "askuri", which is what the seeker typed in. Some ideas for realising the backend: use strtolower(), str_replace(), levenshtein(). Right now I do not have a ready to use code snippet or library.
The table is in CSV accessable on http://maniacdn.net/askuri/latin-unicode/table.csv. Feel free to use this for continuus updating, it's a static link :)

Re: Latin to specialchar table: de- and encrypt stylized names

Posted: 30 May 2017, 21:55
by askuri
Example, how to use it in PHP (why didn't I post this before?):

Code: Select all

<?php
// read the table (original is with ; separator, this function expects ,)
$array = array_map('str_getcsv', file('table.csv')); // reads csv into php array

$subject = "ÐĘЯЯ@"; // example input
foreach ($array as $row) { // do the same for every latin char
	$latin = array_shift($row); // first one is latin, following are any char we want to replace
	$subject = str_ireplace($row, $latin, $subject); // replace them case-insensitively
}

echo $subject;
?>