I am considering to change all of my server locale to C by

"export LC_ALL=C"

Is it a common practice?

I am thinking will there be any side effect on a LAMP server, or should I just leave as using the default of "en_US.UTF-8"?

  • 1
    What do you hope to accomplish by changing this value? – joev Aug 14 '13 at 1:07
  • To avoid issue like this: tdas.wordpress.com/2008/02/03/speed-up-grep – Ryan Aug 14 '13 at 3:55
  • That issue was reported over five years ago; have you been able to run a test with a more recent version of grep? There's a decent chance that the performance is better, given that UTF-8 is becoming more and more prevalent. – joev Aug 14 '13 at 12:40

You might want to edit /etc/default/locale to set the locale as your export command will only affect the current environment. It will not affect already running programs.

The issue you had mentioned regarding grep was fixed a few years ago already:

fixed in grep 2.7, released Sep 20, 2010

In multibyte locales, regular expressions including backreferences
no longer exhibit quadratic complexity (i.e., they are orders
of magnitude faster). [bug present since multi-byte character set
support was introduced in 2.5.2]

In UTF-8 locales, regular expressions including "." can be orders
of magnitude faster.  For example, "grep ." is now twice as fast
as "grep -v ^$", instead of being immensely slower.  It remains
slow in other multibyte locales. [bug present since multi-byte
character set support was introduced in 2.5.2]


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.