I wrote up a quick test which may help. I've opened up a new issue since it seems to be a real bug unless two of us are completely messing up somewhere (never say never ;)).
http://framework.zend.com/issues/browse/ZF-3439 Another quick look shows all XML adapters are open to the same problem, since they also use xml_parser_create without setting an output encoding matching input. Best regards, Paddy Pádraic Brady wrote: > > Hi Thomas, > >>First: Zend_Translate can not handle bilge pumps. I think you meant the >>ISO-8859-1 standard. > > A slip of the finger, dear Watson ;) > >>Zend_Translate does not change any source... if your source is UTF you will >>get UTF. If it's Win1503 you will get Win 1503... > > I'm going to be a pain in the butt (until I realise I'm wrong and slink > away embarrassed ;)). I did a quick test since it seemed a bit odd, and > I'm getting the same result. The input's strlen is 1, and the output's is > 2. Somewhere along the line, and my guess is xml_parser_create() as > suggested, a single byte character miraculously transformed into a double > byte u+diacritic. Adding the optional ISO-8859-1 encoding output option to > xml_parser_create() in the TMX adapter corrects the problem and reverts to > outputting the single-byte umlaut. > > I'm not an expert here, so I could be off the wall. The PHP docs state > that input encoding is detected from the input source, but the output is > independently encoded as UTF-8 by default since PHP 5.0.2. So Pierre's > input, without further changes, is indeed output under UTF-8. > Specifically, the ISO-8859-1 umlaut becomes a double-byte UTF-8 u with a > diacritic attached. That at least explains the mangled output Pierre is > getting - the browser is simple taking the Content-Type seriously and > printing the two bytes as separate chars. > > Like I said, I could be completely wrong, or using a bad test case. But > something doesn't add up right now. > > Best regards, > Paddy > > Pádraic Brady > > http://blog.astrumfutura.com > http://www.patternsforphp.com > OpenID Europe Foundation > > > > > ----- Original Message ---- > From: Thomas Weidner <[EMAIL PROTECTED]> > Cc: Zend Framework General <[email protected]> > Sent: Tuesday, June 10, 2008 8:54:13 PM > Subject: Re: [fw-general] Zend_Translate in iso-8859-1 > > I already answered his question 17:04 CET. > > Just 2 things: > > First: Zend_Translate can not handle bilge pumps. I think you meant the > ISO-8859-1 standard. > Second: I am using the western european standard myself in the testbed and > in my applications without any problems. > > Zend_Translate does not change any source... if your source is UTF you > will > get UTF. If it's Win1503 you will get Win 1503... > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- > From: "Pádraic Brady" <[EMAIL PROTECTED]> > To: "Spring Pierre" <[EMAIL PROTECTED]> > Cc: "Zend Framework General" <[email protected]> > Sent: Tuesday, June 10, 2008 9:27 PM > Subject: Re: [fw-general] Zend_Translate in iso-8859-1 > > > Maybe Thomas can clarify, since I don't use ISO-8849-1, but in the TMX > adapter I noted it's using the XML Parser extension but it doesn't specify > an output encoding. As far as I know the default out encoding, independent > of the input encoding, is UTF-8. Could this be creating a subtle encoding > transfer? In goes ISO-8849-1, out comes slightly corrupted UTF-8 for > Pierre's 00F6 umlauts? > > Pádraic Brady > > http://blog.astrumfutura.com > http://www.patternsforphp.com > OpenID Europe Foundation Member-Subscriber > > > > > ----- Original Message ---- > From: Spring Pierre <[EMAIL PROTECTED]> > To: Wolfgang Forstmeier <[EMAIL PROTECTED]> > Cc: [email protected] > Sent: Tuesday, June 10, 2008 4:17:54 PM > Subject: Re: [fw-general] Zend_Translate in iso-8859-1 > > dear wolfgang, > >>> i build a Zend_Form and need the validation messages to be >>> translated. >>> >>> i wrote an xml file with the error messages [1]. i tried both, an >>> iso-8859-1 >>> and utf-8 version of the xml file. >>> >>> i then attach the translation to the form and render it. cf. [2] >>> >>> i seem to have a problem with encoding though. > >> Maybe some more description what is going wrong would be nice. >> What is really wrong ? > > the encoding seems to be wrong . i'd need to output ISO-8859-1, yet > it outputs UTF-8. > > the xml file i read the translations from is in ISO-8859-1 ... > > c.f. screenshot [1] > > greetings ... pierre > > == > [1] http://wiki.caillou.ch/_media/code:zend_translate_encoding_problem.png > -- > Liip AG // Rte de la Fonderie 7 // CH-1700 Fribourg > Fon 026 4222511 // Key id 0x5BF5F8FA // www.liip.ch > > ----- > Pádraic Brady > > http://blog.astrumfutura.com > http://www.patternsforphp.com > OpenID Europe Foundation - Irish Representative > ----- Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com OpenID Europe Foundation - Irish Representative -- View this message in context: http://www.nabble.com/Zend_Translate-in-iso-8859-1-tp17756317p17781660.html Sent from the Zend Framework mailing list archive at Nabble.com.
