help with HTML escaping...
Andre Garzia
soapdog at mac.com
Sun Mar 27 18:13:32 EST 2005
Swami,
Thanks! Actually for my needs, a simple get the htmltext of fld body,
worked, it gave me all the entities escaped. :D
Thanks again!
andre
On Mar 27, 2005, at 5:51 PM, Sivakatirswami wrote:
> Yes, I do this a lot ... dealing with diacriticals in books that
> have to go out to the web. Complete transformations of one font into
> another font (every single character gets replaced), fixing broken
> links in 100's of web pages... I have found absolutely nothing that
> can do this as efficiently as Revolution. Sometimes transforming
> characters across thousands of files. Operations that may take only 22
> seconds across 3,000 web pages (on the LAN) in Revolution, would take
> hours in GoLive and probably GoLive would simply choke in the end.
> Because it is doing so much tracking and updating of it's internal
> data base of the webSite. I've been using my Rev App for 4 years and
> *never* had a single failure, bad write or corrupt file, not once.
>
> First rule: Don't read data into a field.
>
> Basic implementation is to get a list of paths to files that need work
> in one field called "fileList"
>
> then run scripts against those files like this, where the fld ""sNr"
> is a series of lines with
>
> [stringToReplace] tab [stringToChangeTo] in each line.
>
> I keep a library of these "arrays" in a substack and pass them to fld
> "sNr"
>
> writes to a new file, same name with galley # added.
>
> on mouseUp
> set the cursor to watch
> put ticks() into tStart
> put empty into fld "resultList"
> answer "This operation will output a new file with " & quote & "2" &
> quote & cr &\
> "appended to the file name. Continue?" with "No" or "Yes"
> if it is "No" then exit MouseUp
> set the caseSensitive to (the hilite of btn "Case sensitive")
> set the itemdel to tab
> put fld "sNr" into tChanges
> put fld "fileList" into tFileList
>
> repeat for each line y in tFileList
> set the itemdel to tab
>
> put url ("file:"&y) into tFileData
>
> repeat for each line z in tChanges
> replace (item 1 of z) with (item 2 of z) in tFileData
> end repeat
>
> if the hilite of btn "Write New File" then
> set the itemdel to "."
> put item 1 of y &"-g2" & ".txt" into x
> put tFileData into url ("file:"&x)
> else
> put tFiledata into url ("file:"&y)
> end if
>
> end repeat
> calcTime(tStart)
> end mouseUp
>
> It's actually incredibly simple.
>
> If you want the stack, let me know off line..it's a bit of a mess but
> works great.
>
> Sivakatirswami
>
>
>
>
>
>
>
> On Mar 26, 2005, at 1:27 PM, Andre Garzia wrote:
>
>> Hi Folks,
>>
>> I am having some trouble escaping text with international characters
>> for HTML pages. I thought a simple approach, I built a field with all
>> the escapes like:
>>
>> á
>> é
>> ç Á
>> ...
>>
>> and stuff like that, then I used a repeat loop to loop thru the data
>> replacing the ocurrence of the first char with the corresponding HTML
>> entity, guess what? It does not work, the replace command is not
>> replacing them, it's a big field, it works only for some lines,
>> others are completelly ignored, I used the debugger to iterate thru
>> the code, and guess what, it's all appearing correct just the engine
>> is telling the the "" inside the field is not the same "" that it
>> needs to escape... damn. Any clue out there? does anyone here got a
>> HTML escaping routines for international chars?
>>
>> Andre
>> --
>> Andre Alves Garzia ð 2004 ð BRAZIL
>> http://studio.soapdog.org
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
--
Andre Alves Garzia ð 2004 ð BRAZIL
http://studio.soapdog.org
More information about the use-livecode
mailing list