Add getpreferredencoding. Support @euro modifiers. Fixes #554676.
The @euro part is backported to 2.2.3.
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 2e056cf..46cbee2 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -38,5 +38,7 @@
     testformat("%20.f", -42, grouping=1, output='                 -42')
     testformat("%+10.f", -4200, grouping=1, output='    -4,200')
     testformat("%-10.f", 4200, grouping=1, output='4,200     ')
+    # Invoke getpreferredencoding to make sure it does not cause exceptions,
+    locale.getpreferredencoding()
 finally:
     locale.setlocale(locale.LC_NUMERIC, oldlocale)