summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-06-13 15:21:25 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-06-13 15:41:55 -0400
commitb5bbe64ad2ec51417ef02ac52304ed45fe37be3f (patch)
tree71f1b45882f215a6d886d3bc08954c02a54e6af0 /locale.c
parent7053d92917f7cb46452de86dc4c6d8644cae849c (diff)
downloadperl-b5bbe64ad2ec51417ef02ac52304ed45fe37be3f.tar.gz
Remove MAD.
MAD = Misc Attribute Decoration; unmaintained attempt at preserving the Perl parse tree more faithfully so that automatic conversion to Perl 6 would have been easier.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/locale.c b/locale.c
index 64c0d8d6f1..2b66c8cb9e 100644
--- a/locale.c
+++ b/locale.c
@@ -1300,81 +1300,6 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
# endif /* USE_LOCALE_MONETARY */
#endif /* HAS_LOCALECONV */
-#if 0 && defined(HAS_STRERROR) && defined(USE_LOCALE_MESSAGES)
-
-/* This code is ifdefd out because it was found to not be necessary in testing
- * on our dromedary test machine, which has over 700 locales. There, looking
- * at just the currency symbol gave essentially the same results as doing this
- * extra work. Executing this also caused segfaults in miniperl. I left it in
- * so as to avoid rewriting it if real-world experience indicates that
- * dromedary is an outlier. Essentially, instead of returning abpve if we
- * haven't found illegal utf8, we continue on and examine all the strerror()
- * messages on the platform for utf8ness. If all are ASCII, we still don't
- * know the answer; but otherwise we have a pretty good indication of the
- * utf8ness. The reason this doesn't necessarily help much is that the
- * messages may not have been translated into the locale. The currency symbol
- * is much more likely to have been translated. The code below would need to
- * be altered somewhat to just be a continuation of testing the currency
- * symbol. */
- int e;
- unsigned int failures = 0, non_ascii = 0;
- char *save_messages_locale = NULL;
-
- /* Like above for LC_CTYPE, we set LC_MESSAGES to the locale of the
- * desired category, if it isn't that locale already */
-
- if (category != LC_MESSAGES) {
-
- save_messages_locale = stdize_locale(savepv(setlocale(LC_MESSAGES,
- NULL)));
- if (! save_messages_locale) {
- goto cant_use_messages;
- }
-
- if (strEQ(save_messages_locale, save_input_locale)) {
- Safefree(save_input_locale);
- }
- else if (! setlocale(LC_MESSAGES, save_input_locale)) {
- Safefree(save_messages_locale);
- goto cant_use_messages;
- }
- }
-
- /* Here the current LC_MESSAGES is set to the locale of the category
- * whose information is desired. Look through all the messages */
-
- for (e = 0;
-#ifdef HAS_SYS_ERRLIST
- e <= sys_nerr
-#endif
- ; e++)
- {
- const U8* const errmsg = (U8 *) Strerror(e) ;
- if (!errmsg)
- break;
- if (! is_utf8_string(errmsg, 0)) {
- failures++;
- break;
- }
- else if (! is_ascii_string(errmsg, 0)) {
- non_ascii++;
- }
- }
-
- /* And, if we changed it, restore LC_MESSAGES to its original locale */
- if (save_messages_locale) {
- setlocale(LC_MESSAGES, save_messages_locale);
- Safefree(save_messages_locale);
- }
-
- /* Any non-UTF-8 message means not a UTF-8 locale; if all are valid,
- * any non-ascii means it is one; otherwise we assume it isn't */
- return (failures) ? FALSE : non_ascii;
-
- }
- cant_use_messages:
-
-#endif
DEBUG_L(PerlIO_printf(Perl_debug_log,
"Assuming locale %s is not a UTF-8 locale\n",