Re: [Webware-discuss] htmlEncode, Database-access

Marc Saric wrote:
> 1. HTML: Converting ASCII-strings from HTML and back: I found
> htmlEncode, but it seems to be incomplete (german umlauts missing for
> example, most special signs too). Of course it is easy to enhance it
> (add to the list of known special signs), but maybe someone has a better
> sollution or came up with something else. Feedback would be appreciated.
You don't really need to encode any of those characters, you can just
include them directly if your character encoding is correct.
--
Ian Bicking / ianb@... / http://blog.ianbicking.org

Thread view

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I am new to Webware and want to use it to write some database-centric
Intranet-apps. Therefore some newbie-questions will follow: :-)
1. HTML: Converting ASCII-strings from HTML and back: I found
htmlEncode, but it seems to be incomplete (german umlauts missing for
example, most special signs too). Of course it is easy to enhance it
(add to the list of known special signs), but maybe someone has a better
sollution or came up with something else. Feedback would be appreciated.
2. Databases: I looked through the available doku regarding
database-adapters and -for my first project- settled on the minimal
sollution using a DB-API 2.0 compliant approach (pygresql) without fancy
ORM-layers or similar things.
I considered using MiddleKit, but unfortunately my DB of choice
(PostgreSQL) does not seem to be supported.
How much work would it be to enhance MiddleKit to support PostgreSQL?
Or is something allready in CVS?
Is using MiddleKit worth the effort?
Should I switch to MySQL? :-)
Thanks in advance.
- --
Bye,
Marc Saric
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFArh3evKxJUF29wRIRAj69AJ4x/ycJberBjou/pnngOJUeiebOBACgrfn3
GQFitzIBZkloPsuX4FUQyws=
=bmoj
-----END PGP SIGNATURE-----

Marc Saric wrote:
> 1. HTML: Converting ASCII-strings from HTML and back: I found
> htmlEncode, but it seems to be incomplete (german umlauts missing for
> example, most special signs too). Of course it is easy to enhance it
> (add to the list of known special signs), but maybe someone has a better
> sollution or came up with something else. Feedback would be appreciated.
You don't really need to encode any of those characters, you can just
include them directly if your character encoding is correct.
--
Ian Bicking / ianb@... / http://blog.ianbicking.org

Ian Bicking wrote:
> You don't really need to encode any of those characters, you can just
> include them directly if your character encoding is correct.
Right, but I don't want to assume anything on the client side (or even
web-server-side) and want to stick to html-encoded stuff.
At least I can dimly remember, that character encoding can break, if
either the web-server or web-browser does not get it right.
--
Bye,
Marc Saric http://www.marcsaric.de

On May 22, 2004, at 5:14 AM, Marc Saric wrote:
> Ian Bicking wrote:
>> You don't really need to encode any of those characters, you can just
>> include them directly if your character encoding is correct.
>
> Right, but I don't want to assume anything on the client side (or even
> web-server-side) and want to stick to html-encoded stuff.
>
> At least I can dimly remember, that character encoding can break, if
> either the web-server or web-browser does not get it right.
It can get a little weird in some situations, but as long as you set
the character encoding in the Content-Type header it should work pretty
consistently. The meta-http-equiv character set seems unreliable.
Entities are also unreliable, as they are only recognized to varying
degrees, but even not-so-modern browsers understand UTF-8.
--
Ian Bicking | ianb@... | http://blog.ianbicking.org

Shouldnt be too hard. With databases, just keep an eye on threading
issues. It'll get ya everytime (Ie if one process is using a cursor and
another one snatches it, well... *bang*.) MySQL is not particularly thread
safe (and even cursors marked thread safe are still not really thread
safe, because a thread safe cursor actually doesnt make sense... think
about it). Ie.... process locks.
--
Shayne O'Neill
http://perth.indymedia.org
I know how hard it is for you to put food on your family."
----George W. Bush
On Fri, 21 May 2004, Marc Saric wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I am new to Webware and want to use it to write some database-centric
> Intranet-apps. Therefore some newbie-questions will follow: :-)
>
> 1. HTML: Converting ASCII-strings from HTML and back: I found
> htmlEncode, but it seems to be incomplete (german umlauts missing for
> example, most special signs too). Of course it is easy to enhance it
> (add to the list of known special signs), but maybe someone has a better
> sollution or came up with something else. Feedback would be appreciated.
>
> 2. Databases: I looked through the available doku regarding
> database-adapters and -for my first project- settled on the minimal
> sollution using a DB-API 2.0 compliant approach (pygresql) without fancy
> ORM-layers or similar things.
>
> I considered using MiddleKit, but unfortunately my DB of choice
> (PostgreSQL) does not seem to be supported.
>
> How much work would it be to enhance MiddleKit to support PostgreSQL?
> Or is something allready in CVS?
> Is using MiddleKit worth the effort?
> Should I switch to MySQL? :-)
>
> Thanks in advance.
>
> - --
> Bye,
> Marc Saric
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFArh3evKxJUF29wRIRAj69AJ4x/ycJberBjou/pnngOJUeiebOBACgrfn3
> GQFitzIBZkloPsuX4FUQyws=
> =bmoj
> -----END PGP SIGNATURE-----
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> Webware-discuss mailing list
> Webware-discuss@...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
>

Hallo,
Marc Saric hat gesagt: // Marc Saric wrote:
> 2. Databases: I looked through the available doku regarding
> database-adapters and -for my first project- settled on the minimal
> sollution using a DB-API 2.0 compliant approach (pygresql) without fancy
> ORM-layers or similar things.
>
> I considered using MiddleKit, but unfortunately my DB of choice
> (PostgreSQL) does not seem to be supported.
>
> How much work would it be to enhance MiddleKit to support PostgreSQL?
I think, support for Pg is already done somewhere, mabye in the CVS.
> Or is something allready in CVS?
> Is using MiddleKit worth the effort?
> Should I switch to MySQL? :-)
NOOO!! I did encounter lots of Python<->MySQLdb problems, that I fixed
by using Pg instead.
You might however be interested in SQLObject.og as a userfriendly DB
wrapper. It supports Postgres and lots of other databases out of the
box. I use it for example on http://normalmailorder.de which runs
Webware, SQLObject and PostgreSQL.
Ciao
--
Frank Barknecht _ ______footils.org__