Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses a bug in SimpleDateFormatter #77

Merged
merged 1 commit into from Dec 25, 2011

Conversation

xeno-by
Copy link
Member

@xeno-by xeno-by commented Dec 25, 2011

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.

paulp added a commit that referenced this pull request Dec 25, 2011
Addresses a bug in SimpleDateFormatter
@paulp paulp merged commit 8a862fd into scala:master Dec 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants