Revert "bpo-29571: Use correct locale encoding in test_re (#149)" (#554)

This reverts commit ace5c0fdd9b962e6e886c29dbcea72c53f051dc4.
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 92d2c13..1d7fb76 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1399,7 +1399,7 @@
 
     def test_locale_flag(self):
         import locale
-        enc = locale.getpreferredencoding(False)
+        _, enc = locale.getlocale(locale.LC_CTYPE)
         # Search non-ASCII letter
         for i in range(128, 256):
             try: