On a site that I am working on, if users change the language settings of their browser to "English (UK)" or an equivalent setting, it changes all of the locations of the dollar sign($) to the sign for the British pound (£). This is incorrect and I need to disallow it. Does anyone know of a solution.
The back-end of the site is supported in Java.
Thank you ahead of time for all suggestions.
A browser may interpret a generic currency symbol as the relevant character for its locale.
It is possible that your application is interpreting browser GET requests and inferring the locale from them (for example, the user-agent may include "en-GB") and the code is then replacing the generic symbol you specified with the right character for the locale and sending that to the browser.
If you want a dollar and nothing else, specify a dollar sign.
This is not standard browser behavior. If this is happening then it can only be because of your application's code, either on the server or client side. Figure out where this is happening and disable it at the source, not after the fact.
I suspect the problem is that money amounts are being stored as plain numbers, and formatted using a NumberFormat obtained by calling getCurrencyInstance for the user's selected locale. If the amounts are always in dollars, then this is the wrong thing to do. Instead, construct a DecimalFormat with a dollar sign in it.
For Pete's sake, don't try and fix this in Javascript.