morosumo > 25-08-14, 03:43 PM
Xuân Thanh > 25-08-14, 10:58 PM
Function VNItoTCVN3(vnstr As String)
Dim c As String, i As Long
Dim db As Boolean
For i = 1 To Len(vnstr)
db = False
If i < Len(vnstr) Then
c = Mid(vnstr, i + 1, 1)
If c = "ù" Or c = "ø" Or c = "û" Or c = "õ" Or c = "ï" Or _
c = "ê" Or c = "é" Or c = "è" Or c = "ú" Or c = "ü" Or c = "ë" Or _
c = "â" Or c = "á" Or c = "à" Or c = "å" Or c = "ã" Or c = "ä" Or _
c = "Ù" Or c = "Ø" Or c = "Û" Or c = "Õ" Or c = "Ï" Or _
c = "Ê" Or c = "É" Or c = "È" Or c = "Ú" Or c = "Ü" Or c = "Ë" Or _
c = "Â" Or c = "Á" Or c = "À" Or c = "Å" Or c = "Ã" Or c = "Ä" Then db = True
End If
If db Then
c = Mid(vnstr, i, 2)
Select Case c
Case "aù": c = "¸"
Case "aø": c = "µ"
Case "aû": c = "¶"
Case "aõ": c = "·"
Case "aï": c = "¹"
Case "aê": c = "¨"
Case "aé": c = "¾"
Case "aè": c = "»"
Case "aú": c = "¼"
Case "aü": c = "½"
Case "aë": c = "Æ"
Case "aâ": c = "©"
Case "aá": c = "Ê"
Case "aà": c = "Ç"
Case "aå": c = "È"
Case "aã": c = "É"
Case "aä": c = "Ë"
Case "eù": c = "Ð"
Case "eø": c = "Ì"
Case "eû": c = "Î"
Case "eõ": c = "Ï"
Case "eï": c = "Ñ"
Case "eâ": c = "ª"
Case "eá": c = "Õ"
Case "eà": c = "Ò"
Case "eå": c = "Ó"
Case "eã": c = "Ô"
Case "eä": c = "Ö"
Case "où": c = "ã"
Case "oø": c = "ß"
Case "oû": c = "á"
Case "oõ": c = "â"
Case "oï": c = "ä"
Case "oâ": c = "«"
Case "oá": c = "è"
Case "oà": c = "å"
Case "oå": c = "æ"
Case "oã": c = "ç"
Case "oä": c = "é"
Case "ôù": c = "í"
Case "ôø": c = "ê"
Case "ôû": c = "ë"
Case "ôõ": c = "ì"
Case "ôï": c = "î"
Case "uù": c = "ó"
Case "uø": c = "ï"
Case "uû": c = "ñ"
Case "uõ": c = "ò"
Case "uï": c = "ô"
Case "öù": c = "ø"
Case "öø": c = "õ"
Case "öû": c = "ö"
Case "öõ": c = "÷"
Case "öï": c = "ù"
Case "yù": c = "ý"
Case "yø": c = "ú"
Case "yû": c = "û"
Case "yõ": c = "ü"
Case "AÙ": c = "¸"
Case "AØ": c = "µ"
Case "AÛ": c = "¶"
Case "AÕ": c = "·"
Case "AÏ": c = "¹"
Case "AÉ": c = "¾"
Case "AÈ": c = "»"
Case "AÚ": c = "¼"
Case "AÜ": c = "½"
Case "AË": c = "Æ"
Case "AÁ": c = "Ê"
Case "AÀ": c = "Ç"
Case "AÅ": c = "È"
Case "AÃ": c = "É"
Case "AÄ": c = "Ë"
Case "EÙ": c = "Ð"
Case "EØ": c = "Ì"
Case "EÛ": c = "Î"
Case "EÕ": c = "Ï"
Case "EÏ": c = "Ñ"
Case "EÁ": c = "Õ"
Case "EÀ": c = "Ò"
Case "EÅ": c = "Ó"
Case "EÃ": c = "Ô"
Case "EÄ": c = "Ö"
Case "OÙ": c = "ã"
Case "OØ": c = "ß"
Case "OÛ": c = "á"
Case "OÕ": c = "â"
Case "OÏ": c = "ä"
Case "OÁ": c = "è"
Case "OÀ": c = "å"
Case "OÅ": c = "æ"
Case "OÃ": c = "ç"
Case "OÄ": c = "é"
Case "ÔÙ": c = "í"
Case "ÔØ": c = "ê"
Case "ÔÛ": c = "ë"
Case "ÔÕ": c = "ì"
Case "ÔÏ": c = "î"
Case "UÙ": c = "ó"
Case "UØ": c = "ï"
Case "UÛ": c = "ñ"
Case "UÕ": c = "ò"
Case "UÏ": c = "ô"
Case "ÖÙ": c = "ø"
Case "ÖØ": c = "õ"
Case "ÖÛ": c = "ö"
Case "ÖÕ": c = "÷"
Case "ÖÏ": c = "ù"
Case "YÙ": c = "ý"
Case "YØ": c = "ú"
Case "YÛ": c = "û"
Case "YÕ": c = "ü"
Case "AÊ": c = "¡"
Case "AÂ": c = "¢"
Case "EÂ": c = "£"
Case "OÂ": c = "¤"
End Select
Else
c = Mid(vnstr, i, 1)
Select Case c
Case "ô": c = "¬"
Case "i": c = "i"
Case "í": c = "Ý"
Case "ì": c = "×"
Case "æ": c = "Ø"
Case "ó": c = "Ü"
Case "ò": c = "Þ"
Case "ö": c = ""
Case "î": c = "þ"
Case "ñ": c = "®"
Case "A": c = "A"
Case "Ô": c = "¥"
Case "I": c = "I"
Case "Í": c = "Æ"
Case "Ý": c = "Ø"
Case "U": c = "U"
Case "Ö": c = "¦"
Case "Y": c = "Y"
Case "Ñ": c = "§"
End Select
End If
VNItoTCVN3 = VNItoTCVN3 + c
If db Then i = i + 1
Next i
End Function
morosumo > 26-08-14, 09:29 AM