Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Interchange: users

Character encodings and FCK editor

 

 

Interchange users RSS feed   Index | Next | Previous | View Threaded


lists at gmnet

Aug 5, 2009, 10:48 AM

Post #1 of 10 (1459 views)
Permalink
Character encodings and FCK editor

Hi List;

I am having lots of trouble with this and I hope someone can please help
me through this, point me in the write direction, or talk me down from
the leadge!

I am wondering if there is a "best practice" or examples for using the
FCK editor for editing and saving content but not in the admin area. I
have a field in a database called "content" and I want it to be editable
by affiliates via the FCK editor. Again, this is NOT in the admin area,
but in the catalog itself. The problem I am having is that when they
paste certain things from a pdf or word file (they have to be able to do
this!) things look fine in the editor, but when they save it, things
sometimes get encoded in strange ways. I have FCK configured to paste
as plain text only! (no strait paste, or paste from word is enabled). I
have been writing strange filters to try to catch them, but this seems
the totally wrong way to go. Does anybody have a sample of a form that
calls up data, sticks it into FCK, then when submitted, saves back to
the table in such a way that strange characters don't get introduced?
It does not seem to be a browser issue at all.

Thanks!
Rick



--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


gert at 3edge

Aug 5, 2009, 10:53 AM

Post #2 of 10 (1385 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

> -----Original Message-----
> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> Sent: Wednesday, August 05, 2009 8:49 PM
> To: interchange-users [at] icdevgroup
> Subject: [ic] Character encodings and FCK editor
>
> Hi List;
>
> I am having lots of trouble with this and I hope someone can please
> help
> me through this, point me in the write direction, or talk me down from
> the leadge!
>
> I am wondering if there is a "best practice" or examples for using the
> FCK editor for editing and saving content but not in the admin area. I
> have a field in a database called "content" and I want it to be
> editable
> by affiliates via the FCK editor. Again, this is NOT in the admin
> area,
> but in the catalog itself. The problem I am having is that when they
> paste certain things from a pdf or word file (they have to be able to
> do
> this!) things look fine in the editor, but when they save it, things
> sometimes get encoded in strange ways. I have FCK configured to paste
> as plain text only! (no strait paste, or paste from word is enabled).
> I
> have been writing strange filters to try to catch them, but this seems
> the totally wrong way to go. Does anybody have a sample of a form that
> calls up data, sticks it into FCK, then when submitted, saves back to
> the table in such a way that strange characters don't get introduced?
> It does not seem to be a browser issue at all.

Interchange version?


> Thanks!
> Rick
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by Green Mountain Network, and is
> believed to be clean.
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users [at] icdevgroup
> http://www.icdevgroup.org/mailman/listinfo/interchange-users


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


bill at bottlenose-wine

Aug 5, 2009, 1:44 PM

Post #3 of 10 (1399 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

On Aug 5, 2009, at 1:53 PM, Gert van der Spoel wrote:

>> -----Original Message-----
>> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
>> users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
>> Sent: Wednesday, August 05, 2009 8:49 PM
>> To: interchange-users [at] icdevgroup
>> Subject: [ic] Character encodings and FCK editor
>>
>> Hi List;
>>
>> I am having lots of trouble with this and I hope someone can please
>> help
>> me through this, point me in the write direction, or talk me down
>> from
>> the leadge!
>>
>> I am wondering if there is a "best practice" or examples for using
>> the
>> FCK editor for editing and saving content but not in the admin
>> area. I
>> have a field in a database called "content" and I want it to be
>> editable
>> by affiliates via the FCK editor. Again, this is NOT in the admin
>> area,
>> but in the catalog itself. The problem I am having is that when they
>> paste certain things from a pdf or word file (they have to be able to
>> do
>> this!) things look fine in the editor, but when they save it, things
>> sometimes get encoded in strange ways. I have FCK configured to
>> paste
>> as plain text only! (no strait paste, or paste from word is enabled).
>> I
>> have been writing strange filters to try to catch them, but this
>> seems
>> the totally wrong way to go. Does anybody have a sample of a form
>> that
>> calls up data, sticks it into FCK, then when submitted, saves back to
>> the table in such a way that strange characters don't get introduced?
>> It does not seem to be a browser issue at all.
>
> Interchange version?
If the users are pasting from Word why not enable paste from word in
the toolbar?

-Bill Carr

_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Aug 5, 2009, 3:47 PM

Post #4 of 10 (1384 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

On Wed, 2009-08-05 at 20:53 +0300, Gert van der Spoel wrote:
> > -----Original Message-----
> > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > Sent: Wednesday, August 05, 2009 8:49 PM
> > To: interchange-users [at] icdevgroup
> > Subject: [ic] Character encodings and FCK editor
> >
> > Hi List;
> >
> > I am having lots of trouble with this and I hope someone can please
> > help
> > me through this, point me in the write direction, or talk me down from
> > the leadge!
> >
> > I am wondering if there is a "best practice" or examples for using the
> > FCK editor for editing and saving content but not in the admin area. I
> > have a field in a database called "content" and I want it to be
> > editable
> > by affiliates via the FCK editor. Again, this is NOT in the admin
> > area,
> > but in the catalog itself. The problem I am having is that when they
> > paste certain things from a pdf or word file (they have to be able to
> > do
> > this!) things look fine in the editor, but when they save it, things
> > sometimes get encoded in strange ways. I have FCK configured to paste
> > as plain text only! (no strait paste, or paste from word is enabled).
> > I
> > have been writing strange filters to try to catch them, but this seems
> > the totally wrong way to go. Does anybody have a sample of a form that
> > calls up data, sticks it into FCK, then when submitted, saves back to
> > the table in such a way that strange characters don't get introduced?
> > It does not seem to be a browser issue at all.
>
> Interchange version?
>
>
> > Thanks!
> > Rick
> >
> >

Oh sorry, I am using IC version 5.6.1 and FCK Version 2.6.3

I have to use paste as text because these people (local government
employees - fine people...) are pasting from all kinds of sources and
there were many problems due to this. The solution was alway "paste as
text" but these people don't even know their own email addresses
nevermind how to paste something as plain text. When I let them use
paste from word, or if they paste html from their old site, PDF
documents, word perfect, whatever, things get really ugly! There are
all kinds of characters that get messed up or just show up out of
nowhere and they can't figure out how to deal with it, give up, and are
almost ready to scrap it!

Preface:
One of the main problems is that it is a site for a city. They expect
everything to work perfect even on the tiny budget. My bid won the
contract and so I need to be able to tell them the truth about
limitations, and come up with solid work-arounds. If some things just
can't be done, I need to make sure that I am not the cause. Competition
is really tough and someone else with different software will jump in
soon and the city will scrap my whole project if my solutions don't work
where other platforms will.. Anyway, Don't mean to ramble but my back
is against the wall with time and I am just lost with this issue.

Thanks!
Rick







--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Aug 5, 2009, 6:42 PM

Post #5 of 10 (1389 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

On Wed, 2009-08-05 at 16:44 -0400, Bill Carr wrote:
> On Aug 5, 2009, at 1:53 PM, Gert van der Spoel wrote:
>
> >> -----Original Message-----
> >> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> >> users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> >> Sent: Wednesday, August 05, 2009 8:49 PM
> >> To: interchange-users [at] icdevgroup
> >> Subject: [ic] Character encodings and FCK editor
> >>
> >> Hi List;
> >>
> >> I am having lots of trouble with this and I hope someone can please
> >> help
> >> me through this, point me in the write direction, or talk me down
> >> from
> >> the leadge!
> >>
> >> I am wondering if there is a "best practice" or examples for using
> >> the
> >> FCK editor for editing and saving content but not in the admin
> >> area. I
> >> have a field in a database called "content" and I want it to be
> >> editable
> >> by affiliates via the FCK editor. Again, this is NOT in the admin
> >> area,
> >> but in the catalog itself. The problem I am having is that when they
> >> paste certain things from a pdf or word file (they have to be able to
> >> do
> >> this!) things look fine in the editor, but when they save it, things
> >> sometimes get encoded in strange ways. I have FCK configured to
> >> paste
> >> as plain text only! (no strait paste, or paste from word is enabled).
> >> I
> >> have been writing strange filters to try to catch them, but this
> >> seems
> >> the totally wrong way to go. Does anybody have a sample of a form
> >> that
> >> calls up data, sticks it into FCK, then when submitted, saves back to
> >> the table in such a way that strange characters don't get introduced?
> >> It does not seem to be a browser issue at all.
> >
> > Interchange version?
> If the users are pasting from Word why not enable paste from word in
> the toolbar?
>
> -Bill Carr
>

Hi, thanks Bill;

I would love to keep all the paste options, but the situation is that
they are city department officials that will use this to "paste words"
if you know what I mean. I would not be surprised if they get out a can
of glue. Hard core Luddite's that have the power to kill the whole
project.

I guess I just need to know that I am doing all I can, but I need to
give them clear options that work. Right now, I'm sure that I am doing
things very wrong for example I started writing my own filters to "clean
things up" which is totally wrong. I am just looking for some
direction so I can be confident that things work as good as they can
across platforms, browsers, character encodings, document types etc. Any
issues or problems cannot be due to my fault if you know what I mean.
Since I can't find any "best practices" or samples of this, I feel that
I am the only one doing this, which I also know is not true.

One example right now is when I use the "insert special character" in
the toolbar and put in the (R) for registered... it saves the character
perfect in the database as ®, but then when I insert a "tm" for
trademark, right after the (R) it saves it as ®™ then the next time
I save it, it turns into ®™ and so-on... It keeps growing upon
every save...

Also I need to filter the input to protect the data that gest saved such
as:
filter="restrict_html.a.b.div.em.embed.h1.etc..."

I would like an example or "best practice" for how to set up a form to
call data, stick it in the editor, and save it without character
encoding issues like this.

Anyone?

Thanks again Bill!
Rick








--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


david at endpoint

Aug 5, 2009, 7:09 PM

Post #6 of 10 (1391 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

On Aug 5, 2009, at 8:42 PM, Rick Bragg wrote:

> On Wed, 2009-08-05 at 16:44 -0400, Bill Carr wrote:
>> On Aug 5, 2009, at 1:53 PM, Gert van der Spoel wrote:
>>
>>>> -----Original Message-----
>>>> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
>>>> users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
>>>> Sent: Wednesday, August 05, 2009 8:49 PM
>>>> To: interchange-users [at] icdevgroup
>>>> Subject: [ic] Character encodings and FCK editor
>>>>
>>>> Hi List;
>>>>
>>>> I am having lots of trouble with this and I hope someone can please
>>>> help
>>>> me through this, point me in the write direction, or talk me down
>>>> from
>>>> the leadge!
>>>>
>>>> I am wondering if there is a "best practice" or examples for using
>>>> the
>>>> FCK editor for editing and saving content but not in the admin
>>>> area. I
>>>> have a field in a database called "content" and I want it to be
>>>> editable
>>>> by affiliates via the FCK editor. Again, this is NOT in the admin
>>>> area,
>>>> but in the catalog itself. The problem I am having is that when
>>>> they
>>>> paste certain things from a pdf or word file (they have to be
>>>> able to
>>>> do
>>>> this!) things look fine in the editor, but when they save it,
>>>> things
>>>> sometimes get encoded in strange ways. I have FCK configured to
>>>> paste
>>>> as plain text only! (no strait paste, or paste from word is
>>>> enabled).
>>>> I
>>>> have been writing strange filters to try to catch them, but this
>>>> seems
>>>> the totally wrong way to go. Does anybody have a sample of a form
>>>> that
>>>> calls up data, sticks it into FCK, then when submitted, saves
>>>> back to
>>>> the table in such a way that strange characters don't get
>>>> introduced?
>>>> It does not seem to be a browser issue at all.
>>>
>>> Interchange version?
>> If the users are pasting from Word why not enable paste from word in
>> the toolbar?
>>
>> -Bill Carr
>>
>
> Hi, thanks Bill;
>
> I would love to keep all the paste options, but the situation is that
> they are city department officials that will use this to "paste words"
> if you know what I mean. I would not be surprised if they get out a
> can
> of glue. Hard core Luddite's that have the power to kill the whole
> project.
>
> I guess I just need to know that I am doing all I can, but I need to
> give them clear options that work. Right now, I'm sure that I am
> doing
> things very wrong for example I started writing my own filters to
> "clean
> things up" which is totally wrong. I am just looking for some
> direction so I can be confident that things work as good as they can
> across platforms, browsers, character encodings, document types etc.
> Any
> issues or problems cannot be due to my fault if you know what I mean.
> Since I can't find any "best practices" or samples of this, I feel
> that
> I am the only one doing this, which I also know is not true.
>
> One example right now is when I use the "insert special character" in
> the toolbar and put in the (R) for registered... it saves the
> character
> perfect in the database as ®, but then when I insert a "tm" for
> trademark, right after the (R) it saves it as ®™ then the next
> time
> I save it, it turns into ®™ and so-on... It keeps growing
> upon
> every save...

This particular instance is an artifact of multiple applications of
utf8 encoding without corresponding decoding. If this is within the
context of FCKEditor, it might be outside of the realm of IC itself,
and may be more dependent on FCK's configuration and/or apache's
concept of the current charset for the documents being served/data
being posted.

Regards,

David
--
David Christensen
End Point Corporation
david [at] endpoint





_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


gert at 3edge

Aug 5, 2009, 11:22 PM

Post #7 of 10 (1385 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

> -----Original Message-----
> From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> Sent: Thursday, August 06, 2009 1:48 AM
> To: interchange-users [at] icdevgroup
> Subject: Re: [ic] Character encodings and FCK editor
>
> On Wed, 2009-08-05 at 20:53 +0300, Gert van der Spoel wrote:
> > > -----Original Message-----
> > > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > > Sent: Wednesday, August 05, 2009 8:49 PM
> > > To: interchange-users [at] icdevgroup
> > > Subject: [ic] Character encodings and FCK editor
> > >
> > > Hi List;
> > >
> > > I am having lots of trouble with this and I hope someone can please
> > > help
> > > me through this, point me in the write direction, or talk me down
> from
> > > the leadge!
> > >
> > > I am wondering if there is a "best practice" or examples for using
> the
> > > FCK editor for editing and saving content but not in the admin
> area. I
> > > have a field in a database called "content" and I want it to be
> > > editable
> > > by affiliates via the FCK editor. Again, this is NOT in the admin
> > > area,
> > > but in the catalog itself. The problem I am having is that when
> they
> > > paste certain things from a pdf or word file (they have to be able
> to
> > > do
> > > this!) things look fine in the editor, but when they save it,
> things
> > > sometimes get encoded in strange ways. I have FCK configured to
> paste
> > > as plain text only! (no strait paste, or paste from word is
> enabled).
> > > I
> > > have been writing strange filters to try to catch them, but this
> seems
> > > the totally wrong way to go. Does anybody have a sample of a form
> that
> > > calls up data, sticks it into FCK, then when submitted, saves back
> to
> > > the table in such a way that strange characters don't get
> introduced?
> > > It does not seem to be a browser issue at all.
> >
> > Interchange version?
> >
> >
> > > Thanks!
> > > Rick
> > >
> > >
>
> Oh sorry, I am using IC version 5.6.1 and FCK Version 2.6.3

Ok ..

Additional Q's:
Q1: does it work correct via the admin UI, or you do not have the ability to
test this?
Q2: would you have the option to install the nightly build?
Q3: your database has a certain encoding?
Q4: is it possible to paste the snippet of code/page that makes use of the
FCKeditor,
If so paste it at http://paste.me.uk/
This could help in making sure we're on the same base to test this
issue.



> I have to use paste as text because these people (local government
> employees - fine people...) are pasting from all kinds of sources and
> there were many problems due to this. The solution was alway "paste as
> text" but these people don't even know their own email addresses
> nevermind how to paste something as plain text. When I let them use
> paste from word, or if they paste html from their old site, PDF
> documents, word perfect, whatever, things get really ugly! There are
> all kinds of characters that get messed up or just show up out of
> nowhere and they can't figure out how to deal with it, give up, and are
> almost ready to scrap it!
>
> Preface:
> One of the main problems is that it is a site for a city. They expect
> everything to work perfect even on the tiny budget. My bid won the
> contract and so I need to be able to tell them the truth about
> limitations, and come up with solid work-arounds. If some things just
> can't be done, I need to make sure that I am not the cause.
> Competition
> is really tough and someone else with different software will jump in
> soon and the city will scrap my whole project if my solutions don't
> work
> where other platforms will.. Anyway, Don't mean to ramble but my back
> is against the wall with time and I am just lost with this issue.
>
> Thanks!
> Rick
>
>
>
>
>
>
>
> --
> This message has been scanned for viruses and
> dangerous content by Green Mountain Network, and is
> believed to be clean.
>
>
> _______________________________________________
> interchange-users mailing list
> interchange-users [at] icdevgroup
> http://www.icdevgroup.org/mailman/listinfo/interchange-users


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Aug 6, 2009, 8:36 AM

Post #8 of 10 (1373 views)
Permalink
Re: Character encodings and FCK editor [In reply to]

On Thu, 2009-08-06 at 09:22 +0300, Gert van der Spoel wrote:
> > -----Original Message-----
> > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > Sent: Thursday, August 06, 2009 1:48 AM
> > To: interchange-users [at] icdevgroup
> > Subject: Re: [ic] Character encodings and FCK editor
> >
> > On Wed, 2009-08-05 at 20:53 +0300, Gert van der Spoel wrote:
> > > > -----Original Message-----
> > > > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > > > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > > > Sent: Wednesday, August 05, 2009 8:49 PM
> > > > To: interchange-users [at] icdevgroup
> > > > Subject: [ic] Character encodings and FCK editor
> > > >
> > > > Hi List;
> > > >
> > > > I am having lots of trouble with this and I hope someone can please
> > > > help
> > > > me through this, point me in the write direction, or talk me down
> > from
> > > > the leadge!
> > > >
> > > > I am wondering if there is a "best practice" or examples for using
> > the
> > > > FCK editor for editing and saving content but not in the admin
> > area. I
> > > > have a field in a database called "content" and I want it to be
> > > > editable
> > > > by affiliates via the FCK editor. Again, this is NOT in the admin
> > > > area,
> > > > but in the catalog itself. The problem I am having is that when
> > they
> > > > paste certain things from a pdf or word file (they have to be able
> > to
> > > > do
> > > > this!) things look fine in the editor, but when they save it,
> > things
> > > > sometimes get encoded in strange ways. I have FCK configured to
> > paste
> > > > as plain text only! (no strait paste, or paste from word is
> > enabled).
> > > > I
> > > > have been writing strange filters to try to catch them, but this
> > seems
> > > > the totally wrong way to go. Does anybody have a sample of a form
> > that
> > > > calls up data, sticks it into FCK, then when submitted, saves back
> > to
> > > > the table in such a way that strange characters don't get
> > introduced?
> > > > It does not seem to be a browser issue at all.
> > >
> > > Interchange version?
> > >
> > >
> > > > Thanks!
> > > > Rick
> > > >
> > > >
> >
> > Oh sorry, I am using IC version 5.6.1 and FCK Version 2.6.3
>
> Ok ..
>
> Additional Q's:
> Q1: does it work correct via the admin UI, or you do not have the ability to
> test this?
Seems to work fine in the admin UI. it changes the tm into ™

> Q2: would you have the option to install the nightly build?
Yes do have this option

> Q3: your database has a certain encoding?
Database Server info:
# Server version: 5.0.51a-3ubuntu5.4-log
# Protocol version: 10
# Server: Localhost via UNIX socket
# User: root [at] localhos
# MySQL charset: UTF-8 Unicode (utf8)
# MySQL connection collation: utf8_unicode_ci

Table specific info:
# collation: latin1_swedish_ci <---Maybe this is part of my problem??

> Q4: is it possible to paste the snippet of code/page that makes use of the
> FCKeditor,
> If so paste it at http://paste.me.uk/
> This could help in making sure we're on the same base to test this
> issue.
>

I realize that there is allot that I am doing wrong here, and
I am currently in the middle of changing things around. but here goes
anyway...
http://www.paste.me.uk/1335.html

Thanks
rick







--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Aug 7, 2009, 4:27 PM

Post #9 of 10 (1349 views)
Permalink
Re: Character encodings and FCK editor [SOLVED?] [In reply to]

On Thu, 2009-08-06 at 15:36 +0000, Rick Bragg wrote:
> On Thu, 2009-08-06 at 09:22 +0300, Gert van der Spoel wrote:
> > > -----Original Message-----
> > > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > > Sent: Thursday, August 06, 2009 1:48 AM
> > > To: interchange-users [at] icdevgroup
> > > Subject: Re: [ic] Character encodings and FCK editor
> > >
> > > On Wed, 2009-08-05 at 20:53 +0300, Gert van der Spoel wrote:
> > > > > -----Original Message-----
> > > > > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > > > > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > > > > Sent: Wednesday, August 05, 2009 8:49 PM
> > > > > To: interchange-users [at] icdevgroup
> > > > > Subject: [ic] Character encodings and FCK editor
> > > > >
> > > > > Hi List;
> > > > >
> > > > > I am having lots of trouble with this and I hope someone can please
> > > > > help
> > > > > me through this, point me in the write direction, or talk me down
> > > from
> > > > > the leadge!
> > > > >
> > > > > I am wondering if there is a "best practice" or examples for using
> > > the
> > > > > FCK editor for editing and saving content but not in the admin
> > > area. I
> > > > > have a field in a database called "content" and I want it to be
> > > > > editable
> > > > > by affiliates via the FCK editor. Again, this is NOT in the admin
> > > > > area,
> > > > > but in the catalog itself. The problem I am having is that when
> > > they
> > > > > paste certain things from a pdf or word file (they have to be able
> > > to
> > > > > do
> > > > > this!) things look fine in the editor, but when they save it,
> > > things
> > > > > sometimes get encoded in strange ways. I have FCK configured to
> > > paste
> > > > > as plain text only! (no strait paste, or paste from word is
> > > enabled).
> > > > > I
> > > > > have been writing strange filters to try to catch them, but this
> > > seems
> > > > > the totally wrong way to go. Does anybody have a sample of a form
> > > that
> > > > > calls up data, sticks it into FCK, then when submitted, saves back
> > > to
> > > > > the table in such a way that strange characters don't get
> > > introduced?
> > > > > It does not seem to be a browser issue at all.
> > > >
> > > > Interchange version?
> > > >
> > > >
> > > > > Thanks!
> > > > > Rick
> > > > >
> > > > >
> > >
> > > Oh sorry, I am using IC version 5.6.1 and FCK Version 2.6.3
> >
> > Ok ..
> >
> > Additional Q's:
> > Q1: does it work correct via the admin UI, or you do not have the ability to
> > test this?
> Seems to work fine in the admin UI. it changes the tm into &trade;
>
> > Q2: would you have the option to install the nightly build?
> Yes do have this option
>
> > Q3: your database has a certain encoding?
> Database Server info:
> # Server version: 5.0.51a-3ubuntu5.4-log
> # Protocol version: 10
> # Server: Localhost via UNIX socket
> # User: root [at] localhos
> # MySQL charset: UTF-8 Unicode (utf8)
> # MySQL connection collation: utf8_unicode_ci
>
> Table specific info:
> # collation: latin1_swedish_ci <---Maybe this is part of my problem??
>
> > Q4: is it possible to paste the snippet of code/page that makes use of the
> > FCKeditor,
> > If so paste it at http://paste.me.uk/
> > This could help in making sure we're on the same base to test this
> > issue.
> >
>
> I realize that there is allot that I am doing wrong here, and
> I am currently in the middle of changing things around. but here goes
> anyway...
> http://www.paste.me.uk/1335.html
>
> Thanks
> rick
>



OK, I think I have this, and seems acceptable right now. I was making it
way to complex. Word to the wise: simplify!

The goal here is to deal with filtering of input values while using an
FCK editor to allow web users to edit content on an IC website. What is
not covered here is how to deal with authentication or any other user
issue. Issues of authentication, uploading content, etc, are not
addressed here. What is assumed is that you have a fly page for a table
displaying some content, and you want an "edit" form that brings you to
a page that loads the content into an FCK editor with a form to save it.

So far it seems to work nice as a way to build quick and easy FCK editor
for web contributors.

First, when displaying content (In my case, using a fly page, showing a
field called "content" in a table called "groups") simply use something
like the following: (adjust for your restrict_html filter)

[item-filter restrict_html.a.address.b.blockquote.br.h1.h2.h3.h4][item-data groups content][/item-filter]

You can have an edit form and button/link right there, but you don't
need to pass the content field. just the code or id of the record you
want to edit.



Once submitted, now you are in the "edit" page where you show the FCK
editor. (here you can do a "light" authentication to make sure this user
may have the rights to edit...) Grab the "content" field fresh like
this: (this assumes you have a record you are updating, and are passing
the id of that record in a value called "group_code". Also assumes you
have a config set for FCK called "content")

[.query
type=list
label=content_edit
prefix=content_edit
list_prefix=content_edit_list
sql=|
SELECT code, content
FROM groups
WHERE code = "[value group_code]"
LIMIT 0,1
|]
[content_edit_list]
[display type="htmlarea"
name="content"
height="750"
htmlarea_config="content"
value="[content_edit-data groups content]"
]
[/content_edit_list]
[/query]




Once you submit a form with that, there are two options. One is to
update an existing record, the other is to create a new row.

(1) update a current row:

[tag flag write]groups[/tag]
[.query list=1
row-count=1
table=groups
st=sql
sql=|UPDATE groups
SET content = [cgi name="content"
enable_html="1"
filter="restrict_html.a.address.b.blockquote.br.h1.h2.h3.h4
dbi_quote"
]
WHERE code = '[value group_code]'
|]
[/query]



(2) create a new row:

For this, I am setting a quick [tmp content] variable for the "content"
value that was passed in from FCK so I can easily filter it:

[tmp content][cgi name="content"
enable_html="1"
filter="restrict_html.a.address.b.blockquote.br.h1.h2.h3.h4"
][/tmp]

[perl tables=groups]
my $db = $Db{groups};
my %record;
$record{code} = "";
$record{content} = $Scratch->{content};
$Scratch->{key} = $db->set_slice(undef, \%record);
return;
[/perl]




Feedback?

Thanks, and HTH someone.
Rick




--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users


lists at gmnet

Aug 7, 2009, 4:32 PM

Post #10 of 10 (1349 views)
Permalink
Re: Character encodings and FCK editor [SOLVED?] [In reply to]

On Fri, 2009-08-07 at 23:27 +0000, Rick Bragg wrote:
> On Thu, 2009-08-06 at 15:36 +0000, Rick Bragg wrote:
> > On Thu, 2009-08-06 at 09:22 +0300, Gert van der Spoel wrote:
> > > > -----Original Message-----
> > > > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > > > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > > > Sent: Thursday, August 06, 2009 1:48 AM
> > > > To: interchange-users [at] icdevgroup
> > > > Subject: Re: [ic] Character encodings and FCK editor
> > > >
> > > > On Wed, 2009-08-05 at 20:53 +0300, Gert van der Spoel wrote:
> > > > > > -----Original Message-----
> > > > > > From: interchange-users-bounces [at] icdevgroup [mailto:interchange-
> > > > > > users-bounces [at] icdevgroup] On Behalf Of Rick Bragg
> > > > > > Sent: Wednesday, August 05, 2009 8:49 PM
> > > > > > To: interchange-users [at] icdevgroup
> > > > > > Subject: [ic] Character encodings and FCK editor
> > > > > >
> > > > > > Hi List;
> > > > > >
> > > > > > I am having lots of trouble with this and I hope someone can please
> > > > > > help
> > > > > > me through this, point me in the write direction, or talk me down
> > > > from
> > > > > > the leadge!
> > > > > >
> > > > > > I am wondering if there is a "best practice" or examples for using
> > > > the
> > > > > > FCK editor for editing and saving content but not in the admin
> > > > area. I
> > > > > > have a field in a database called "content" and I want it to be
> > > > > > editable
> > > > > > by affiliates via the FCK editor. Again, this is NOT in the admin
> > > > > > area,
> > > > > > but in the catalog itself. The problem I am having is that when
> > > > they
> > > > > > paste certain things from a pdf or word file (they have to be able
> > > > to
> > > > > > do
> > > > > > this!) things look fine in the editor, but when they save it,
> > > > things
> > > > > > sometimes get encoded in strange ways. I have FCK configured to
> > > > paste
> > > > > > as plain text only! (no strait paste, or paste from word is
> > > > enabled).
> > > > > > I
> > > > > > have been writing strange filters to try to catch them, but this
> > > > seems
> > > > > > the totally wrong way to go. Does anybody have a sample of a form
> > > > that
> > > > > > calls up data, sticks it into FCK, then when submitted, saves back
> > > > to
> > > > > > the table in such a way that strange characters don't get
> > > > introduced?
> > > > > > It does not seem to be a browser issue at all.
> > > > >
> > > > > Interchange version?
> > > > >
> > > > >
> > > > > > Thanks!
> > > > > > Rick
> > > > > >
> > > > > >
> > > >
> > > > Oh sorry, I am using IC version 5.6.1 and FCK Version 2.6.3
> > >
> > > Ok ..
> > >
> > > Additional Q's:
> > > Q1: does it work correct via the admin UI, or you do not have the ability to
> > > test this?
> > Seems to work fine in the admin UI. it changes the tm into &trade;
> >
> > > Q2: would you have the option to install the nightly build?
> > Yes do have this option
> >
> > > Q3: your database has a certain encoding?
> > Database Server info:
> > # Server version: 5.0.51a-3ubuntu5.4-log
> > # Protocol version: 10
> > # Server: Localhost via UNIX socket
> > # User: root [at] localhos
> > # MySQL charset: UTF-8 Unicode (utf8)
> > # MySQL connection collation: utf8_unicode_ci
> >
> > Table specific info:
> > # collation: latin1_swedish_ci <---Maybe this is part of my problem??
> >
> > > Q4: is it possible to paste the snippet of code/page that makes use of the
> > > FCKeditor,
> > > If so paste it at http://paste.me.uk/
> > > This could help in making sure we're on the same base to test this
> > > issue.
> > >
> >
> > I realize that there is allot that I am doing wrong here, and
> > I am currently in the middle of changing things around. but here goes
> > anyway...
> > http://www.paste.me.uk/1335.html
> >
> > Thanks
> > rick
> >
>
>
>
> OK, I think I have this, and seems acceptable right now. I was making it
> way to complex. Word to the wise: simplify!
>
> The goal here is to deal with filtering of input values while using an
> FCK editor to allow web users to edit content on an IC website. What is
> not covered here is how to deal with authentication or any other user
> issue. Issues of authentication, uploading content, etc, are not
> addressed here. What is assumed is that you have a fly page for a table
> displaying some content, and you want an "edit" form that brings you to
> a page that loads the content into an FCK editor with a form to save it.
>
> So far it seems to work nice as a way to build quick and easy FCK editor
> for web contributors.
>
> First, when displaying content (In my case, using a fly page, showing a
> field called "content" in a table called "groups") simply use something
> like the following: (adjust for your restrict_html filter)
>
> [item-filter restrict_html.a.address.b.blockquote.br.h1.h2.h3.h4][item-data groups content][/item-filter]
>
> You can have an edit form and button/link right there, but you don't
> need to pass the content field. just the code or id of the record you
> want to edit.
>
>
>
> Once submitted, now you are in the "edit" page where you show the FCK
> editor. (here you can do a "light" authentication to make sure this user
> may have the rights to edit...) Grab the "content" field fresh like
> this: (this assumes you have a record you are updating, and are passing
> the id of that record in a value called "group_code". Also assumes you
> have a config set for FCK called "content")
>
> [.query
> type=list
> label=content_edit
> prefix=content_edit
> list_prefix=content_edit_list
> sql=|
> SELECT code, content
> FROM groups
> WHERE code = "[value group_code]"
> LIMIT 0,1
> |]
> [content_edit_list]
> [.display type="htmlarea"
> name="content"
> height="750"
> htmlarea_config="content"
> value="[content_edit-data groups content]"
> ]
> [/content_edit_list]
> [/query]
>
>
>
>
> Once you submit a form with that, there are two options. One is to
> update an existing record, the other is to create a new row.
>
> (1) update a current row:
>
> [tag flag write]groups[/tag]
> [.query list=1
> row-count=1
> table=groups
> st=sql
> sql=|UPDATE groups
> SET content = [cgi name="content"
> enable_html="1"
> filter="restrict_html.a.address.b.blockquote.br.h1.h2.h3.h4
> dbi_quote"
> ]
> WHERE code = '[value group_code]'
> |]
> [/query]
>
>
>
> (2) create a new row:
>
> For this, I am setting a quick [tmp content] variable for the "content"
> value that was passed in from FCK so I can easily filter it:
>
> [tmp content][cgi name="content"
> enable_html="1"
> filter="restrict_html.a.address.b.blockquote.br.h1.h2.h3.h4"
> ][/tmp]
>
> [perl tables=groups]
> my $db = $Db{groups};
> my %record;
> $record{code} = "";
> $record{content} = $Scratch->{content};
> $Scratch->{key} = $db->set_slice(undef, \%record);
> return;
> [/perl]
>
>
>
>
> Feedback?
>
> Thanks, and HTH someone.
> Rick
>


Oh yea, I forgot to mention, on that final submit to "save" the data, do
a "heavy" authentication check somehow to make sure the user really has
the permissions to do this... (that is another discussion altogether)

Rick


--
This message has been scanned for viruses and
dangerous content by Green Mountain Network, and is
believed to be clean.


_______________________________________________
interchange-users mailing list
interchange-users [at] icdevgroup
http://www.icdevgroup.org/mailman/listinfo/interchange-users

Interchange users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.