aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.c
diff options
context:
space:
mode:
authorPo Lu2023-12-07 14:05:35 +0800
committerPo Lu2023-12-07 14:05:35 +0800
commite4e1e268c8e9f7de6fe5d4b05beb595a1781c02c (patch)
tree35dfa8f1cf3b398eb3369406bf3315169c4e9da3 /src/android.c
parent48965d0862751131eb873b71e39c70e97a683eaa (diff)
downloademacs-e4e1e268c8e9f7de6fe5d4b05beb595a1781c02c.tar.gz
emacs-e4e1e268c8e9f7de6fe5d4b05beb595a1781c02c.zip
Set a default locale on Android
* doc/emacs/android.texi (Android Environment): Revise for change. * src/android.c (initEmacs): Set LANG to either en_US.utf8 or C, subject to whether the system is newer than Android 5.0 (inclusive).
Diffstat (limited to 'src/android.c')
-rw-r--r--src/android.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/android.c b/src/android.c
index 7ca5eab817c..51622f16230 100644
--- a/src/android.c
+++ b/src/android.c
@@ -1455,6 +1455,18 @@ NATIVE_NAME (setEmacsParams) (JNIEnv *env, jobject object,
1455 the possibility of Java locating libemacs later. */ 1455 the possibility of Java locating libemacs later. */
1456 setenv ("EMACS_LD_LIBRARY_PATH", android_lib_dir, 1); 1456 setenv ("EMACS_LD_LIBRARY_PATH", android_lib_dir, 1);
1457 1457
1458 /* If the system is Android 5.0 or later, set LANG to en_US.utf8,
1459 which is understood by the C library. In other instances set it
1460 to C, a meaningless value, for good measure. */
1461
1462 if (emacs_service_object)
1463 {
1464 if (api_level >= 21)
1465 setenv ("LANG", "en_US.utf8", 1);
1466 else
1467 setenv ("LANG", "C", 1);
1468 }
1469
1458 /* Make a reference to the Emacs service. */ 1470 /* Make a reference to the Emacs service. */
1459 1471
1460 if (emacs_service_object) 1472 if (emacs_service_object)