转载:http://www.stmcu.org.cn/module/forum/forum.php?mod=viewthread&tid=599065&highlight=936
//把从 oem2unip[] 和 uni2oem[]两个数组读取元素的部分程序从外部FLASH读取就可以了,得事先用一段程序把oem2unip[] 和 uni2oem[]两个数组存入到外部flash中。
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
WCHAR src, /* Character code to be converted */
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
)
{
const WCHAR *p;
WCHAR c;
int i, n, li, hi;
if (src < 0x80) { /* ASCII */
c = src;
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
hi = sizeof(oem2uni) / 4 - 1;
} else { /* Unicode to OEMCP */
p = uni2oem;
hi = sizeof(uni2oem) / 4 - 1;