Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hieuhiti/52438445fceb9d3c10caf1d78cce6d1e to your computer and use it in GitHub Desktop.
Save hieuhiti/52438445fceb9d3c10caf1d78cce6d1e to your computer and use it in GitHub Desktop.
public function CompositeUnicodeToUnicode($unicode_str){
$unicode_str = str_replace("\u{0065}\u{0309}", "\u{1EBB}",$unicode_str); # ẻ
$unicode_str = str_replace("\u{0065}\u{0301}", "\u{00E9}",$unicode_str); # é
$unicode_str = str_replace("\u{0065}\u{0300}", "\u{00E8}",$unicode_str); # è
$unicode_str = str_replace("\u{0065}\u{0323}", "\u{1EB9}",$unicode_str); # ẹ
$unicode_str = str_replace("\u{0065}\u{0303}", "\u{1EBD}",$unicode_str); # ẽ
$unicode_str = str_replace("\u{00EA}\u{0309}", "\u{1EC3}",$unicode_str); # ể
$unicode_str = str_replace("\u{00EA}\u{0301}", "\u{1EBF}",$unicode_str); # ế
$unicode_str = str_replace("\u{00EA}\u{0300}", "\u{1EC1}",$unicode_str); # ề
$unicode_str = str_replace("\u{00EA}\u{0323}", "\u{1EC7}",$unicode_str); # ệ
$unicode_str = str_replace("\u{00EA}\u{0303}", "\u{1EC5}",$unicode_str); # ễ
$unicode_str = str_replace("\u{0079}\u{0309}", "\u{1EF7}",$unicode_str); # ỷ
$unicode_str = str_replace("\u{0079}\u{0301}", "\u{00FD}",$unicode_str); # ý
$unicode_str = str_replace("\u{0079}\u{0300}", "\u{1EF3}",$unicode_str); # ỳ
$unicode_str = str_replace("\u{0079}\u{0323}", "\u{1EF5}",$unicode_str); # ỵ
$unicode_str = str_replace("\u{0079}\u{0303}", "\u{1EF9}",$unicode_str); # ỹ
$unicode_str = str_replace("\u{0075}\u{0309}", "\u{1EE7}",$unicode_str); # ủ
$unicode_str = str_replace("\u{0075}\u{0301}", "\u{00FA}",$unicode_str); # ú
$unicode_str = str_replace("\u{0075}\u{0300}", "\u{00F9}",$unicode_str); # ù
$unicode_str = str_replace("\u{0075}\u{0323}", "\u{1EE5}",$unicode_str); # ụ
$unicode_str = str_replace("\u{0075}\u{0303}", "\u{0169}",$unicode_str); # ũ
$unicode_str = str_replace("\u{01B0}\u{0309}", "\u{1EED}",$unicode_str); # ử
$unicode_str = str_replace("\u{01B0}\u{0301}", "\u{1EE9}",$unicode_str); # ứ
$unicode_str = str_replace("\u{01B0}\u{0300}", "\u{1EEB}",$unicode_str); # ừ
$unicode_str = str_replace("\u{01B0}\u{0323}", "\u{1EF1}",$unicode_str); # ự
$unicode_str = str_replace("\u{01B0}\u{0303}", "\u{1EEF}",$unicode_str); # ữ
$unicode_str = str_replace("\u{0069}\u{0309}", "\u{1EC9}",$unicode_str); # ỉ
$unicode_str = str_replace("\u{0069}\u{0301}", "\u{00ED}",$unicode_str); # í
$unicode_str = str_replace("\u{0069}\u{0300}", "\u{00EC}",$unicode_str); # ì
$unicode_str = str_replace("\u{0069}\u{0323}", "\u{1ECB}",$unicode_str); # ị
$unicode_str = str_replace("\u{0069}\u{0303}", "\u{0129}",$unicode_str); # ĩ
$unicode_str = str_replace("\u{006F}\u{0309}", "\u{1ECF}",$unicode_str); # ỏ
$unicode_str = str_replace("\u{006F}\u{0301}", "\u{00F3}",$unicode_str); # ó
$unicode_str = str_replace("\u{006F}\u{0300}", "\u{00F2}",$unicode_str); # ò
$unicode_str = str_replace("\u{006F}\u{0323}", "\u{1ECD}",$unicode_str); # ọ
$unicode_str = str_replace("\u{006F}\u{0303}", "\u{00F5}",$unicode_str); # õ
$unicode_str = str_replace("\u{01A1}\u{0309}", "\u{1EDF}",$unicode_str); # ở
$unicode_str = str_replace("\u{01A1}\u{0301}", "\u{1EDB}",$unicode_str); # ớ
$unicode_str = str_replace("\u{01A1}\u{0300}", "\u{1EDD}",$unicode_str); # ờ
$unicode_str = str_replace("\u{01A1}\u{0323}", "\u{1EE3}",$unicode_str); # ợ
$unicode_str = str_replace("\u{01A1}\u{0303}", "\u{1EE1}",$unicode_str); # ỡ
$unicode_str = str_replace("\u{00F4}\u{0309}", "\u{1ED5}",$unicode_str); # ổ
$unicode_str = str_replace("\u{00F4}\u{0301}", "\u{1ED1}",$unicode_str); # ố
$unicode_str = str_replace("\u{00F4}\u{0300}", "\u{1ED3}",$unicode_str); # ồ
$unicode_str = str_replace("\u{00F4}\u{0323}", "\u{1ED9}",$unicode_str); # ộ
$unicode_str = str_replace("\u{00F4}\u{0303}", "\u{1ED7}",$unicode_str); # ỗ
$unicode_str = str_replace("\u{0061}\u{0309}", "\u{1EA3}",$unicode_str); # ả
$unicode_str = str_replace("\u{0061}\u{0301}", "\u{00E1}",$unicode_str); # á
$unicode_str = str_replace("\u{0061}\u{0300}", "\u{00E0}",$unicode_str); # à
$unicode_str = str_replace("\u{0061}\u{0323}", "\u{1EA1}",$unicode_str); # ạ
$unicode_str = str_replace("\u{0061}\u{0303}", "\u{00E3}",$unicode_str); # ã
$unicode_str = str_replace("\u{0103}\u{0309}", "\u{1EB3}",$unicode_str); # ẳ
$unicode_str = str_replace("\u{0103}\u{0301}", "\u{1EAF}",$unicode_str); # ắ
$unicode_str = str_replace("\u{0103}\u{0300}", "\u{1EB1}",$unicode_str); # ằ
$unicode_str = str_replace("\u{0103}\u{0323}", "\u{1EB7}",$unicode_str); # ặ
$unicode_str = str_replace("\u{0103}\u{0303}", "\u{1EB5}",$unicode_str); # ẵ
$unicode_str = str_replace("\u{00E2}\u{0309}", "\u{1EA9}",$unicode_str); # ẩ
$unicode_str = str_replace("\u{00E2}\u{0301}", "\u{1EA5}",$unicode_str); # ấ
$unicode_str = str_replace("\u{00E2}\u{0300}", "\u{1EA7}",$unicode_str); # ầ
$unicode_str = str_replace("\u{00E2}\u{0323}", "\u{1EAD}",$unicode_str); # ậ
$unicode_str = str_replace("\u{00E2}\u{0303}", "\u{1EAB}",$unicode_str); # ẫ
$unicode_str = str_replace("\u{0045}\u{0309}", "\u{1EBA}",$unicode_str); # Ẻ
$unicode_str = str_replace("\u{0045}\u{0301}", "\u{00C9}",$unicode_str); # É
$unicode_str = str_replace("\u{0045}\u{0300}", "\u{00C8}",$unicode_str); # È
$unicode_str = str_replace("\u{0045}\u{0323}", "\u{1EB8}",$unicode_str); # Ẹ
$unicode_str = str_replace("\u{0045}\u{0303}", "\u{1EBC}",$unicode_str); # Ẽ
$unicode_str = str_replace("\u{00CA}\u{0309}", "\u{1EC2}",$unicode_str); # Ể
$unicode_str = str_replace("\u{00CA}\u{0301}", "\u{1EBE}",$unicode_str); # Ế
$unicode_str = str_replace("\u{00CA}\u{0300}", "\u{1EC0}",$unicode_str); # Ề
$unicode_str = str_replace("\u{00CA}\u{0323}", "\u{1EC6}",$unicode_str); # Ệ
$unicode_str = str_replace("\u{00CA}\u{0303}", "\u{1EC4}",$unicode_str); # Ễ
$unicode_str = str_replace("\u{0059}\u{0309}", "\u{1EF6}",$unicode_str); # Ỷ
$unicode_str = str_replace("\u{0059}\u{0301}", "\u{00DD}",$unicode_str); # Ý
$unicode_str = str_replace("\u{0059}\u{0300}", "\u{1EF2}",$unicode_str); # Ỳ
$unicode_str = str_replace("\u{0059}\u{0323}", "\u{1EF4}",$unicode_str); # Ỵ
$unicode_str = str_replace("\u{0059}\u{0303}", "\u{1EF8}",$unicode_str); # Ỹ
$unicode_str = str_replace("\u{0055}\u{0309}", "\u{1EE6}",$unicode_str); # Ủ
$unicode_str = str_replace("\u{0055}\u{0301}", "\u{00DA}",$unicode_str); # Ú
$unicode_str = str_replace("\u{0055}\u{0300}", "\u{00D9}",$unicode_str); # Ù
$unicode_str = str_replace("\u{0055}\u{0323}", "\u{1EE4}",$unicode_str); # Ụ
$unicode_str = str_replace("\u{0055}\u{0303}", "\u{0168}",$unicode_str); # Ũ
$unicode_str = str_replace("\u{01AF}\u{0309}", "\u{1EEC}",$unicode_str); # Ử
$unicode_str = str_replace("\u{01AF}\u{0301}", "\u{1EE8}",$unicode_str); # Ứ
$unicode_str = str_replace("\u{01AF}\u{0300}", "\u{1EEA}",$unicode_str); # Ừ
$unicode_str = str_replace("\u{01AF}\u{0323}", "\u{1EF0}",$unicode_str); # Ự
$unicode_str = str_replace("\u{01AF}\u{0303}", "\u{1EEE}",$unicode_str); # Ữ
$unicode_str = str_replace("\u{0049}\u{0309}", "\u{1EC8}",$unicode_str); # Ỉ
$unicode_str = str_replace("\u{0049}\u{0301}", "\u{00CD}",$unicode_str); # Í
$unicode_str = str_replace("\u{0049}\u{0300}", "\u{00CC}",$unicode_str); # Ì
$unicode_str = str_replace("\u{0049}\u{0323}", "\u{1ECA}",$unicode_str); # Ị
$unicode_str = str_replace("\u{0049}\u{0303}", "\u{0128}",$unicode_str); # Ĩ
$unicode_str = str_replace("\u{004F}\u{0309}", "\u{1ECE}",$unicode_str); # Ỏ
$unicode_str = str_replace("\u{004F}\u{0301}", "\u{00D3}",$unicode_str); # Ó
$unicode_str = str_replace("\u{004F}\u{0300}", "\u{00D2}",$unicode_str); # Ò
$unicode_str = str_replace("\u{004F}\u{0323}", "\u{1ECC}",$unicode_str); # Ọ
$unicode_str = str_replace("\u{004F}\u{0303}", "\u{00D5}",$unicode_str); # Õ
$unicode_str = str_replace("\u{01A0}\u{0309}", "\u{1EDE}",$unicode_str); # Ở
$unicode_str = str_replace("\u{01A0}\u{0301}", "\u{1EDA}",$unicode_str); # Ớ
$unicode_str = str_replace("\u{01A0}\u{0300}", "\u{1EDC}",$unicode_str); # Ờ
$unicode_str = str_replace("\u{01A0}\u{0323}", "\u{1EE2}",$unicode_str); # Ợ
$unicode_str = str_replace("\u{01A0}\u{0303}", "\u{1EE0}",$unicode_str); # Ỡ
$unicode_str = str_replace("\u{00D4}\u{0309}", "\u{1ED4}",$unicode_str); # Ổ
$unicode_str = str_replace("\u{00D4}\u{0301}", "\u{1ED0}",$unicode_str); # Ố
$unicode_str = str_replace("\u{00D4}\u{0300}", "\u{1ED2}",$unicode_str); # Ồ
$unicode_str = str_replace("\u{00D4}\u{0323}", "\u{1ED8}",$unicode_str); # Ộ
$unicode_str = str_replace("\u{00D4}\u{0303}", "\u{1ED6}",$unicode_str); # Ỗ
$unicode_str = str_replace("\u{0041}\u{0309}", "\u{1EA2}",$unicode_str); # Ả
$unicode_str = str_replace("\u{0041}\u{0301}", "\u{00C1}",$unicode_str); # Á
$unicode_str = str_replace("\u{0041}\u{0300}", "\u{00C0}",$unicode_str); # À
$unicode_str = str_replace("\u{0041}\u{0323}", "\u{1EA0}",$unicode_str); # Ạ
$unicode_str = str_replace("\u{0041}\u{0303}", "\u{00C3}",$unicode_str); # Ã
$unicode_str = str_replace("\u{0102}\u{0309}", "\u{1EB2}",$unicode_str); # Ẳ
$unicode_str = str_replace("\u{0102}\u{0301}", "\u{1EAE}",$unicode_str); # Ắ
$unicode_str = str_replace("\u{0102}\u{0300}", "\u{1EB0}",$unicode_str); # Ằ
$unicode_str = str_replace("\u{0102}\u{0323}", "\u{1EB6}",$unicode_str); # Ặ
$unicode_str = str_replace("\u{0102}\u{0303}", "\u{1EB4}",$unicode_str); # Ẵ
$unicode_str = str_replace("\u{00C2}\u{0309}", "\u{1EA8}",$unicode_str); # Ẩ
$unicode_str = str_replace("\u{00C2}\u{0301}", "\u{1EA4}",$unicode_str); # Ấ
$unicode_str = str_replace("\u{00C2}\u{0300}", "\u{1EA6}",$unicode_str); # Ầ
$unicode_str = str_replace("\u{00C2}\u{0323}", "\u{1EAC}",$unicode_str); # Ậ
$unicode_str = str_replace("\u{00C2}\u{0303}", "\u{1EAA}",$unicode_str); # Ẫ
return $unicode_str;
}
@htk68
Copy link

htk68 commented Jun 4, 2024

Cảm ơn bạn nhiều ạ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment