Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change NCRs back to characters
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01350866
Message ID:
01350887
Views:
24
Hi Ben,
LOCAL lcPom,lii,liCount,lcChar,liLen
lcPom="& #21578;& #26481;& #23612;"
lii=AT("&",lcPom)
DO WHILE lii>0
   lcChar=STREXTRACT(lcPom,"&",";",1,1+4) && GET NCR definitions
   liLen=LEN(lcChar)
   lcChar=CHRTRAN(lcChar," &#;","") && remove other characters
   * convert decimal to hex
   lcChar=RIGHT(TRANSFORM(VAL(lcChar),"@0"),4)

   lcPom=STUFF(lcPom,lii,liLen, CHR(EVAL("0x"+LEFT(lcChar,2))) +CHR(EVAL("0x"+RIGHT(lcChar,2))))
   
   lii=AT("&",lcPom)
ENDDO
* this string contain original text in unicode
?lcPom
>Hi All,
>
>Does any body know how (programmatically) to change Unicode NCRs (numerical character references) back to the original characters?
>
>For example, I want to know what Traditional Chinese characters are "& #21578;& #26481;& #23612;". (Here, a space is diliberately added after each "&" to prevent the original characters from being shown on the this webpage.)
>
>TIA,
>Ben
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform