March 24, 2005
charsets galore
after researching charsets for the [expletive deleted] time to help somebody on the forums, i decided it was time to create a tool to do away with some of that kind of tedious labor. so building on the API for java.nio.charset.Charset i whipped out a small CFC to poke and prod the charsets available on a given server (or to be more precise, charsets supported by cf's JRE). you can see it
here. it can be used to deliver the available charsets on a cf server, determine if a charset is supported, and find out if one charset contains another.
oh yeah, once again in case you haven't been paying attention Just Use Unicode. it will save you a lot of trouble over the long run.
on another note, this CFC (100+ lines) was also the first piece of code i wrote from start to finish with cfeclipse. while it wasn't an entirely unpleasant experience, i think it will take me quite a bit more "getting used to" before i give up cfstudio for good.
Comments
Posted By Jason Sheedy / Posted At 3/29/05 5:11 AM
Thanks for the CFC. Its very useful.
About your "Just Use Unicode" advise - it hasnt quite worked for us. We send email on behalf of our clients - encoding emails in UTF-8 is fine for almost all mail clients - Outlook, hotmail, gmail, etc. But UTF-8 emails to Yahoo dont show up properly. We get gibberish. Unless, we are doing something wrong.
Thanks again
Posted By Dharmendar Kumar / Posted At 4/18/05 3:24 PM
no idea. what are you doing that yahoo doesn't like that the others do? but in this day and age i really can't see something like yahoo *not* doing unicode, heck even that dinosaur desktop publishing s/w quark (who's CTO walked into a unicode meeting and announced that his s/w would *never* support unicode) now does.
Posted By PaulH / Posted At 4/18/05 4:02 PM
We were having complaints about this issue. Yahoo will accept utf-8 encoded messages without corrupting them, but they will set the page encoding to ISO-8859-1, even though the embedded email is utf-8 encoded. To display it properly the user only needs to change the encoding in their browser settings. - Jason
Posted By Jason Sheedy / Posted At 4/19/05 1:30 AM
maybe you're under hinting? if you send it html mail & hint at the encoding does it still blow up?
Posted By PaulH / Posted At 4/19/05 7:13 AM
I'm sending html email with the charset set to utf-8, but it still doesn't display automatically. I think the page encoding is fixed and they require you to change it manually for email that are in other encodings. I guess this is to stop their adds and other characters in the page from corrupting. If they automatically switched to whatever was in the email it could cause problems...not with unicode of course, but maybe with some char sets. .. Just a thought. - Jason
Posted By Jason Sheedy / Posted At 4/19/05 2:28 PM
well whatever yahoo is doing, your browser should honor the encoding hint. besides the cfmail charset, have you tried a plain metaheader? so s/w will only read the charset from that. i think my daughter has a yahoo account, i'll take a look at tha tonite.
Posted By PaulH / Posted At 4/21/05 11:59 AM
Well, Yahoo changes the Meta tags in the email to : <xmeta http-equiv="Content-Type" content="text/html; charset=UTF-8">
so in effect, the meta tags charset in the email is ignored by the browser.
Posted By Dharmendar Kumar / Posted At 4/21/05 2:01 PM