Re: UTF-8 forms and database, still some special characters get through as things like fi Why?
Re: UTF-8 forms and database, still some special characters get through as things like fi Why?
- Subject: Re: UTF-8 forms and database, still some special characters get through as things like fi Why?
- From: Ramsey Lee Gurley <email@hidden>
- Date: Thu, 12 Nov 2009 08:11:54 -0500
Hi Johan,
Just a short checklist that I can think of... Don't forget:
1) The database needs to be storing values in UTF-8. If it isn't, then all your effort is wasted :) For MySQL that means a db url like
jdbc:mysql://localhost/Example?capitalizeTypenames=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
And setting your default charset and collation in your my.cnf file.
2) Different fonts may not have all the characters to display the different characters. If you're using a default stylesheet, then the browsers may be displaying differently simply because of fonts. Speaking of stylesheets, you probably want to encode that in UTF-8 also. Start your stylesheet with something like
@charset "UTF-8";
@import url("reset.css");
/* Begin site CSS */
3) Set eclipse encoding
4) Use Wonder. Set encoding in the properties file
# Project Encoding
er.extensions.ERXApplication.DefaultEncoding=UTF-8
5) Set encoding in the page wrapper
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd">
6) Localizable.strings should be encoded in UTF-16
That's all I can think of off the top of my head. Anyone have more? Perhaps we should put up a wiki page just for project encoding since it seems to be something a lot of people stumble on.
Ramsey
On Nov 12, 2009, at 6:07 AM, Johan Henselmans wrote:
> Reading David Griffith's struggle with the euro sign, I thought checking myself if that worked in my test application.
>
> What I did was: go to a textfield in a form, then (on a mac) press shift and alt key, and go over the keyboard from 1 in the upper left to / in the lower right.
>
> Save the stuff, or do something with it, like going to a next form or back or whatever.
>
> Interestingly, it Seems that some characters are not picked up by the UTF-8, while others are.
>
> These are the results in Safari:
>
> ⁄€‹›fifl‡°·‚—±Œ„´‰ˇÁ¨ˆØ∏”’ÅÍÎÏ˝ÓÔÒÚÆ»`¸˛Ç◊ı˜Â¯˘¿
>
> Here in Firefox:
>
> ⁄€‹›fifl‡°··‚—±Œ„´‰ˇÁ¨ˆØ∏”’ÅÍÎÏ˝ÓÔÒÚÆ»¸˛Ç◊ı˜Â¯˘¿
>
> This is WebObjects 5.4.3, latest wonder, OS X 10.5.8 latest security updates
>
> Can anyone explain to me why that is?
>
> (I hope the mailserver does not screw up).
>
> Regards,
>
> Johan Henselmans
> http://www.netsense.nl
> Tel: +31-20-6267538
> Fax: +31-20-6279159
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden