char(4) not replaceable?

Sannyasin Sivakatirswami katir at hindu.org
Sun Apr 18 17:08:47 EDT 2004


I'm having quite a time here re-purposing text from InDesign for the 
web. Thank God for Revolution home grown tools. Goal is to "downsize" 
all characters to the 1-127 ASCII set. Adobe is using all kinds of 
invisible characters and even some strange entities for white 
spacing... I've been able to squash most of them with the function 
below, but

   replace numToChar(4) with ""  in tText

is not working... it appears in BBEdit as a square box non-printable 
character but Revolution doesn't seem to recognize it and even after 
running the following against the text it's still in there... 
Fortunately, it doesn't show in FireFox (great browser by the way) or 
Safari, but it *is* in the html source... since, from experience, such 
gremlins can bite you later on... i would just as soon find a way to 
clear these out... fyi it's a discretionary hyphen in the original 
indesign... i paste into Rev and  run this ascii checker and get 
integer 4

on mouseup
  ## a discretionary hyphen copied and pasted from IDCS
## into a field and selected
   put the selection into jai
   repeat for each char x in jai
     put cr & charTonum(x) & cr after hum
   end repeat
   put hum after the selection
end mouseup

returns char(4)

But, the following does not remove it

function transformChars tText
   put tText into tText
   replace "”"  with quote in tText
   replace "“"  with quote in tText
   replace "’"  with "'" in tText
   replace "‘"  with "'" in jai
   replace "—" with "--" in tText
   replace "–" with "-" in tText
   replace numToChar(4) with ""  in tText
   replace numToChar(28) with Quote  in tText
   replace numToChar(29) with Quote  in tText
   replace numToChar(24) with "'"  in tText
   replace numToChar(25) with "'"  in tText
   replace numToChar(26) with quote  in tText
   replace numToChar(201) with quote  in tText
   replace numToChar(4) with ""  in tText ## doesn't do it...
   replace " '" with "'" in tText
   put "? " & quote into tExtraOpticalSpace
   put "?" & quote into tSpaceOut
   replace tExtraOpticalSpace with tSpaceOut in tText
   put ". " & quote into tExtraOpticalSpace
   put "." & quote into tSpaceOut
   replace tExtraOpticalSpace with tSpaceOut in tText
   put "! " & quote into tExtraOpticalSpace
   put "!" & quote into tSpaceOut
   replace tExtraOpticalSpace with tSpaceOut in tText
   return tText
end transformChars

??


Sannyasin Sivakatirswami
Himalayan Academy Publications
at Kauai's Hindu Monastery
katir at hindu.org

www.HimalayanAcademy.com,
www.HinduismToday.com
www.Gurudeva.org
www.Hindu.org


More information about the use-livecode mailing list