How to using BLOB by Rev2.0 & MySQL4.1

Jan Schenkel janschenkel at yahoo.com
Wed Jun 18 08:45:00 EDT 2003


--- Rev <rev at forest-e.co.jp> wrote:
> Hi Jan,
> Thank you for your wonderful technique!
> 
> I have a one more another question also about a
> character set.
> 
> When using MySQL and Rev2.0, which character set
> should be used?
> I tried ucs2 which is 16bit Unicode. (because Rev2.0
> was 16bit unicode)
> It seems that however, use of ucs2 was too early
> also at MySQL4.1.
> 
> If MySQL and Rev are already used, I will want you
> to teach me about the 
> character set setup  of MySQL.
> 
> Regards,
> 
> #generally in Japan, ujis (EUC-JP) and sjis
> (Shift-JIS) are used.
> 
> 
> Yujis
> 

Hi Yujis,

To be honest with you, I hardly know anything about
unicode ; I think I'd try and get around the issue by
storing the htmlText of the field in the database --
that way you needn't worry about it too much, and as a
bonus, you can save style info.
However, this means you'll have to do some work
yourself instead of relying on the database linked
fields provided by RunRev.

Let's see if I can whip up a recipe :
1) we use an inbetween field that holds the htmlText
2) when the display field is updated, we update the
inbetween field and trigger the revDB update procedure
3) when the user navigates through the records, we
need to update our display field accordingly

Step by step :
- we'll start by making the field that needs to
display and edit the htmlText ; let's call it
"unidisplay"
- we'll also need to make a field that will act as
layer in between our field and the database ; we'll
give it the name "inbetween"
- link the field "inbetween" to the database, and make
sure 'Update after editing' is checked
- in order to save changes to the database, we need to
set the script of field "unidisplay" to :
  on closeField
    put the htmlText of me into fld "inbetween"
    -- now let's trigger the update process
    send closeField to fld "inbetween"
  end closeField
- assuming you have a set of navigation buttons
(first,prev,next,last), group these, and add the
following script to the group :
  on mouseUp
    send "UpdateHtmlText" to field "unidisplay"
    pass mouseUp
  end mouseUp
- now we must add an extra handler to the script of
field "unidisplay"
  on UpdateHtmlText
    set the htmlText of me to the text of fld
"inbetween"
  end UpdateHtmlText
- once your tests show everything works properly, you
can hide field "inbetween" and nobody will ever know

Admittedly, I didn't test this technique, but it
sounds to me like it ought to work (*)

Hope this helped,

Jan Schenkel.

(*) Yes, I like to delude myself ;-)

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the use-livecode mailing list