mySQL and accented chars revisited

Peter Haworth pete at lcsql.com
Wed Nov 4 20:06:56 EST 2015


It would depend if they had been properly encoding the data in the database
or not.  If yes, then using textDecode when SELECTing should get you the
correct results.  If no, you'd need to do the one-time conversion I
described (assuming it works of course!).
Pete

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Wed, Nov 4, 2015 at 4:59 PM, John Dixon <dixonja at hotmail.co.uk> wrote:

>
>
> Yes I am using LC7... I should have mentioned that...
> Peter, thank you for your suggestion, I will try that..:-)
>
> I have just had a thought... How would you go about handling accented
> chars if you were put in the position of using a mySQL database, belonging
> to someone else,  that had never seen liveCode before ?
>
> > Hi John,
> > Sounds like you're using LC7 since I see textDecode in there.
> >
> > I don;t know enough about the URL side of things but I think the issue on
> > the database side is what you are doing when you INSERT or UPDATE the
> > data.  It needs to be textEncoded at that point.  After that, you need to
> > textDecode it every time you SELECT it.
> >
> > If you haven't textEncoded the data, you'll need to write a script that
> > takes care of that.  I haven't tried this but I think if you SELECT every
> > record in your database without textDecoding it, then textEncode it and
> > UPDATE it back into the database, that will fix it.  Please try this on a
> > copy of your database, not the live version!
> >
> > Once you've done that and added the textEncode/textDecode logic to your
> > database handlers, I think you'll get your è back!
> >
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> > Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> > SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> >
> > On Wed, Nov 4, 2015 at 4:33 PM, John Dixon <dixonja at hotmail.co.uk>
> wrote:
> >
> > > In a mySQL database I have a name... Bordeaux-Bègles
> > > I call it from the database into a liveCode stack and it comes out as
> ...
> > > Bordeaux-BÈgles
> > >
> > > from within a card script :-
> > >
> > >    put "http://www.xxxxxxxx.com/rugbyapp/rugby.lc?A=fixtures&thediv="
> &
> > > theLeague into theURL
> > >    put URL theURL into temp
> > >    put temp into theFixtures
> > >
> > > within the corresponding .lc script :-
> > >
> > > if tAction = "fixtures" then
> > >    put $_GET["thediv"] into thedivision
> > >
> > >    get revDataFromQuery( tab, return, theDataRef, "SELECT * FROM
> fixtures
> > > where league='" & thedivision & "' ;")
> > >    put it into temp
> > >    put temp
> > >    revCloseDataBase theDataRef
> > >    quit
> > > end if
> > >
> > > if I change
> > >  put temp into theFixtures
> > > to
> > > put textdecode(temp,"UTF-8") into thefixtures
> > >
> > > the I get Bordeaux-Bgles... the e, never mind the accent does not
> > > appear... I seem to bang my head against a wall over this time and time
> > > again...
> > >
> > > Help... please... I want my è back :-)
> > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list