scala/scala — pull request #77 by xeno-by (2011-12-25 15:14:33+00:00)
Title: Addresses a bug in SimpleDateFormatter

The point is that in Windows with non-English locale the "MMMM" part turns into gibberish. SimpleDateFormatter asks the OS for a byte array that represents month name in system locale, and then transcodes these bytes into utf-8 regardless of the system encoding. On my laptop (with Russian locale) the result looks as following:

build time: 25 ─хърсЁ№ 2011, 15:57:23

Just in case you don't know Russian, this is a meaningless set of characters =)

The solution is to get these bytes from the crazy string produced by SimpleDateFormatter and create a new string that uses correct encoding. However, even if you do this in Ant (which requires writing a custom task), the result will not be perfect:

build time: 25 Декабрь 2011, 15:57:23

Now these characters indeed say "December" in Russian, but the grammatical case of the word "Декабрь" doesn't agree with the numeral "25", so the entire printout isn't a correct Russian phrase.