|
Posted by Erwin Moller on 03/30/07 08:32
Hi group,
I could use a bit of guidance on the following matter.
I am starting a new project now and must make some decisions regarding
encoding.
Environment: PHP4.3, Postgres7.4.3
I must be able to receive forminformation and store that in a database and
later produce it on screen on the client (just plain HTML).
Nothing special. I do this for many years, but I never paid a lot of
attention to special characters.
A few day ago I discovered that the euro-sign is not defined in all
fontfamilies.
They cannot produce the right sign no matter if I use € or the
hexadecimal equivalent.
After a little research I found I could put font-tags around the euro-sign
with another font-family (Arial in this case) to get the Euro sign.
I am completely graphical impaired, and only understand programmingcode (and
HTML/JavaScript of course) , so this is a weak point on my side, hence this
question.
I target on Europe only at the moment (no need for Chineese
charactersupport)
That said, will the following setup make sense?
Postgresql db encoding scheme: LATIN1
In the headers of all my HTML: content-type: text/html charset: iso-8859-1
A few related questions:
1) Will people be able to copy/paste info from other sources (like
wordprocessing programs and other websites) into my forms?
2) Can I use regular expressions as I am used to (ASCII) in my PHP code?
Will I match e acute, eurosign, etc?
3) Will the roundtrip describe here under have problems with normal expected
european characters?
client copies some text from some source ->
paste in the form ->
receive by PHP ->
insert in Postgresql (or update) ->
retrieve from postgresql ->
display as HTML (with content-type: text/html charset: iso-8859-1)
Is that OK?
Any pitfalls?
Should I maybe use UTF-8?
Any pointers are hugely appriciated because, to me, this is all quite
confusing.
Thanks in advance!
Regards,
Erwin Moller
[Back to original message]
|