Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Problems with danish char in database >Thread Next - Re: Problems with danish char in database Re: Problems with danish char in databaseTo: NULL Date: 4/2/2008 11:32:00 AM On 2 Apr, 14:05, "Tine M=FCller" <ti...@email.dk> wrote: > Can someone help me what code to change so it's functioning with danish ch= ar > which is in the database? I had a good answer, but the accursed Google Groups interface ate it 8-( Lose the <meta> in your page. You're sending a HTTP-Header too (better idea anyway) and that will take precedence. As the page is claiming to be UTF-8, then you'd better send UTF-8 / Unicode characters in it, not ISO-8859 characters. If your DB is working in ISO-8859 already, then you might find it easier to change the page generation code to send the right HTTP header. Read up (Wikipedia is good) on Unicode, ISO-8859 and the distinctions between "character sets" (lists of squiggles that humans use) and "character encoding" (sequences of bytes that computers use to refer to these squiggles). You _must_ use a character set that includes the squiggle you need. Danish is easy (commonplace ISO-8859-1 suffices), Czech or Polish is harder. In general these days, go straight to Unicode. This works for all languages at once, ISO-8859 requires you to swap between ISO-8859-1 and ISO-8859-4 depending on which side of the Baltic you are. You then need an encoding that works for the character set you use and is configured so that your DB content matches your page (or gets translated) and your page's header matches your page's content. Use UTF-8 for Unicode, use the relevant ISO-8859-* for ISO-8859 (and you would have to swap between sides of the Baltic). Alternatively (a very bad idea, I only mention it to save a follow-up pinhead doing so), use plain old ASCII as an encoding and HTML numeric character entities or HTML entity references. You will find that numeric character entities are no easier to generate than UTF-8 (if your DB contains ISO-8859) and that entity references are a big chunk of tedious look-up code to create (maybe a PHP library exists for this). This approach is tedious, but it does work in cases where you can't fix the web server's HTTP-Headers to indicate a correct or useful encoding. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
