myself vs utf-8

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm
Location: italy

myself vs utf-8

Post by tzenobite » Mon Apr 02, 2012 10:37 pm

there's a way to get a webpage's content (with "get URL" etc) without have to fight against html codes like ! or ’" or ì ? :shock:
i'm building a sort of ereader for a website, i get the stories reading html pages from the site (with "get URL" as i said), then i strip all the useless code and tags, but i still have a text full of codes where i will have " or è or ! or …, etc
it's possible to automatically "decode" the page (stripped of all the tags) without have to

Code: Select all

replace "√†" with "à"
and so on?
thanks
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: myself vs utf-8

Post by Mark » Tue Apr 03, 2012 9:44 am

Hi ...,

Before you process the text, you need to convert it from UTF8 to plain text:

Code: Select all

put url "http://some.utf8text.xyz" into myData
put unidecode(uniencode(myData,"UTF8")) into myData
-- now you can process the data
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm
Location: italy

Re: myself vs utf-8

Post by tzenobite » Tue Apr 03, 2012 6:48 pm

wow, it works incredibly fast, thanks :-)
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

n9yty
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 52
Joined: Thu Feb 28, 2013 11:33 pm

Re: myself vs utf-8

Post by n9yty » Tue Mar 05, 2013 7:40 am

This works wonderfully on my Mac, but on the Android (real or emulated) it leaves strange characters.

Post Reply

Return to “Internet”