Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace Funky HTML
#1
Any ideas for making this better? I'm sure there is a fancy method of doing this, but my method is just brute force!

Right now QM cannot be running in "Unicode" (Tools -> Options -> [General] -> [] Unicode)


Member function str.ReplaceHTML
Code:
Copy      Help
str CharList=
;À    À
;à    à
;Á    Á
;á    á
;    Â
;â    â
;à   Ã
;ã    ã
;Ä    Ä
;ä    ä
;Å    Å
;å    å
;Æ    Æ
;æ    æ
;Ç    Ç
;ç    ç
;Р   Đ
;Р   Ð
;ð    ð
;È    È
;è    è
;É    É
;é    é
;Ê    Ê
;ê    ê
;Ë    Ë
;ë    ë
;ƒ    ƒ
;Ì    Ì
;ì    ì
;Í    Í
;í    í
;Π   Î
;î    î
;Ï    Ï
;ï    ï
;Ñ    Ñ
;ñ    ñ
;Ò    Ò
;ò    ò
;Ó    Ó
;ó    ó
;Ô    Ô
;ô    ô
;Õ    Õ
;õ    õ
;Ö    Ö
;ö    ö
;Ø    Ø
;ø    ø
;Œ    Œ
;œ    œ
;Š    Š
;š    š
;ß    ß
;Þ    Þ
;þ    þ
;Ù    Ù
;ù    ù
;Ú    Ú
;ú    ú
;Û    Û
;û    û
;Ü    Ü
;ü    ü
;Ý    Ý
;ý    ý
;Ÿ    Ÿ
;ÿ    ÿ
;Ž    Ž
;ž    ž

ICsv v=CreateCsv()
v.Separator="[9]"
v.FromString(CharList)
for int'r 0 v.RowCount
,this.findreplace(v.Cell(r 0) v.Cell(r 1))

this.findreplace("—" "-")
this.findreplace("’" "'")
this.findreplace("“" "''")
this.findreplace("”" "''")
this.findreplace("," ",")
#2
I would use replacerx with callback function. It would replace each found non-ASCII character to &#XXX;.
#3
Please show Smile

That's is if you have the time.

-Jim


Forum Jump:


Users browsing this thread: 1 Guest(s)