ZF-12498: Zend_Measure_Length bad encoding

Description

On the unit array in Zend_Measure_Length, there're some encoding errors. Even if I'm in UTF-8 I can't see these units correctly :

ANGSTROM must be Å instead of � BICRON must be µµ instead of �� BOHR must be a0 instead of � DOUZIEME_WATCH and DOUZIEME must be douzième instead of douzi�me all MICRO* must be µ... instead of �... MILLIMICRON must be mµ instead of m� PE must be pé instead of p�

All non-ascii characters are currently displayed as �

You can see that is also visible on the documentation : http://framework.zend.com/apidoc/1.9/…

Thanks

Comments

What encoding have you set for your locale? and for your output? I suspect we have our output encoding wrong for the API docs, so that's a straw man -- I need to know what conditions you have that are displaying the incorrect encoding. Some sample code would be helpful as well.

My locale is FR_fr, with UTF-8 encoding and my output is in UTF-8 too. My IDEs are paramtered in UTF-8 without BOM. I try with Eclipse and Notepad++.

Here are my headers sent by Firefox on the doc : {quote} Content-Length 224261 Content-Type text/html; charset=UTF-8 Date Fri, 04 Jan 2013 14:51:26 GMT ... {quote}

So I'm still in UTF-8.

Looking at your sources for docs, I can see you're using encoding="iso-8859-1" for the xml tag's attribute, so maybe it came from this for the docs.

But I meant those encoding errors are inside Zend's sources. I don't run any sample script using the Zend_Measure_Length on my applications, I just found it. Here is code sample using this package: {quote} <?php $unit = new Zend_Measure_Length(10, Zend_Measure_Length::BOHR); echo $unit; //Shows "10 a�" on a browser, with utf-8 encoding. ?> {quote}

I hope I helped you to fix it, even if I don't use this package. I just did to make Zend better ;) Thanks

The file {{Zend/Measure/Length.php}} is corrupted.

Oh bad :(

Won't be fixed? No reported issues about this corruption? I don't find anything on it when searching in your issue tracker

Thanks

{quote}Won't be fixed? No reported issues about this corruption? I don't find anything on it when searching in your issue tracker{quote} I think, until now, no one has used this units. We will fix this.

Great. Thank you!

@Nicolas Please check the patch file and give a feedback. Thanks.

I have used this dictionary as reference: http://www.unc.edu/~rowlett/units

The patch is ok. I used the same dictionary as you as reference in the descrption of this issue.

Thanks a lot for your availability!

Fixed on trunk (25198) and release-1.12 (25199)

Fix used the "SUBSCRIPT ZERO" sign for the unit "Bohr".