Public Function OEMConvert(ByRef Text As String, ByVal FromAscii As Boolean) As String Static OInit As Boolean Static Os(255) As Byte 'Ascii Static Oc(255) As Byte 'Ansi Dim t() As Byte Dim i As Long If Not OInit Then For i = 0 To 255 Os(i) i: Oc(i) i Next Os(132) 228: Os(148) 246: Os(129) = 252: Os(225) = 223: Os(142) = 196: Os(153) = 214: Os(154) = 220: Os(128) = 199 Os(130) 233: Os(131) 226: Os(133) = 224: Os(134) = 229: Os(135) = 231: Os(136) = 234: Os(137) = 235: Os(138) = 232 Os(139) 239: Os(140) 238: Os(143) = 197: Os(144) = 201: Os(147) = 244: Os(150) = 251: Os(151) = 249: Os(20) = 182 Os(145) 230: Os(146) 198: Os(155) = 162: Os(156) = 163: Os(166) = 170: Os(167) = 186: Os(171) = 189: Os(172) = 188 Os(237) 216: Os(241) 177: Os(246) = 247: Os(253) = 178: Os(21) = 167: Os(157) = 165 Oc(228) 132: Oc(246) 148: Oc(252) = 129: Oc(223) = 225: Oc(196) = 142: Oc(214) = 153: Oc(220) = 154: Oc(199) = 128 Oc(233) 130: Oc(226) 131: Oc(224) = 133: Oc(229) = 134: Oc(231) = 135: Oc(234) = 136: Oc(235) = 137: Oc(232) = 138 Oc(239) 139: Oc(238) 140: Oc(197) = 143: Oc(201) = 144: Oc(244) = 147: Oc(251) = 150: Oc(249) = 151: Oc(182) = 20: Oc(230) 145: Oc(198) 146: Oc(162) = 155: Oc(163) = 156: Oc(170) = 166: Oc(186) = 167: Oc(189) = 171: Oc(188) = 172: Oc(216) 237: Oc(177) 241: Oc(247) = 246: Oc(178) = 253: Oc(167) = 21: Oc(165) = 157 OInit = True End If If (Len(Text) = 0) Then Exit Function t = StrConv(Text, vbFromUnicode) If FromAscii Then For i = 0 To UBound(t) t(i) = Os(t(i)) Next Else For i = 0 To UBound(t) t(i) = Oc(t(i)) Next End If OEMConvert = StrConv(t, vbUnicode) End Function