Skip to content

Instantly share code, notes, and snippets.

View SmMichael418's full-sized avatar

Mykhailo Smoliakov SmMichael418

  • Kiev
View GitHub Profile
@SmMichael418
SmMichael418 / gist:7b941bd822dfd8308a8e06795f8f20ee
Created April 23, 2017 10:34
Encryption unicode string in PHP (RU)
<?php
function escape_win ($path){
$path = strtoupper ($path);
return strtr($path, array("\U0430"=>"а", "\U0431"=>"б", "\U0432"=>"в",
"\U0433"=>"г", "\U0434"=>"д", "\U0435"=>"е", "\U0451"=>"ё", "\U0436"=>"ж", "\U0437"=>"з", "\U0438"=>"и",
"\U0439"=>"й", "\U043A"=>"к", "\U043B"=>"л", "\U043C"=>"м", "\U043D"=>"н", "\U043E"=>"о", "\U043F"=>"п",
"\U0440"=>"р", "\U0441"=>"с", "\U0442"=>"т", "\U0443"=>"у", "\U0444"=>"ф", "\U0445"=>"х", "\U0446"=>"ц",
"\U0447"=>"ч", "\U0448"=>"ш", "\U0449"=>"щ", "\U044A"=>"ъ", "\U044B"=>"ы", "\U044C"=>"ь", "\U044D"=>"э",
"\U044E"=>"ю", "\U044F"=>"я", "\U0410"=>"А", "\U0411"=>"Б", "\U0412"=>"В", "\U0413"=>"Г", "\U0414"=>"Д",
"\U0415"=>"Е", "\U0401"=>"Ё", "\U0416"=>"Ж", "\U0417"=>"З", "\U0418"=>"И", "\U0419"=>"Й", "\U041A"=>"К",