diff --git a/include/functions b/include/functions index f40997d9..a5ab3dbc 100644 --- a/include/functions +++ b/include/functions @@ -510,8 +510,10 @@ fi if [ ${SHOW} -eq 1 ]; then - # Display (counting with -m instead of -c, to support language locale) - LINESIZE=`echo "${TEXT}" | wc -m | tr -d ' '` + # Display: + # - counting with -m instead of -c, to support language locale + # - wc needs LANG to deal with multi-bytes characters but LANG has been unset in include/consts... + LINESIZE=`export LC_ALL= ; export LANG="${DISPLAY_LANG}";echo "${TEXT}" | wc -m | tr -d ' '` if [ ${SHOWDEBUG} -eq 1 ]; then DEBUGTEXT=" [${PURPLE}DEBUG${NORMAL}]"; else DEBUGTEXT=""; fi if [ ${INDENT} -gt 0 ]; then SPACES=$((62 - INDENT - LINESIZE)); fi if [ ${SPACES} -lt 0 ]; then SPACES=0; fi diff --git a/lynis b/lynis index 2e29608e..f1471bff 100755 --- a/lynis +++ b/lynis @@ -49,6 +49,9 @@ # Version number of report files (when format changes in future) REPORT_version_major="1"; REPORT_version_minor="0" REPORT_version="${REPORT_version_major}.${REPORT_version_minor}" + + DISPLAY_LANG=$LANG # requiered by function Display to deal with multi-bytes characters. + # ################################################################################# #