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

[Item 12] toString() vs. localization #16

Open
mikaelstaldal opened this issue Jun 24, 2020 · 0 comments
Open

[Item 12] toString() vs. localization #16

mikaelstaldal opened this issue Jun 24, 2020 · 0 comments

Comments

@mikaelstaldal
Copy link

I think there is one point about toString() which could be worth being mentioned in Item 12.

  • You should not misuse toString() for displaying objects in a user interface, since that will preclude localization. Rather use java.text.MessageFormat or something similar for that purpose.

This is also highlighted in the text which says that phone numbers have a standard string representation. This "standard" is actually only valid in US, Canada and the other countries with country code 1. Elsewhere in the world, phone numbers looks different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant