refactor setting of local encoding; remove from top-level omniperf

wrapper and push into base class via a companion utility function

Signed-off-by: Karl W Schulz <karl.schulz@amd.com>


[ROCm/rocprofiler-compute commit: 27a57bdafb]
This commit is contained in:
Karl W Schulz
2024-03-08 17:20:08 -06:00
committed by Karl W. Schulz
parent aada8d8e92
commit 9d7dde19b0
3 changed files with 15 additions and 9 deletions
@@ -22,6 +22,7 @@
# SOFTWARE.
##############################################################################el
import locale
import logging
import sys
import os
@@ -593,3 +594,13 @@ def print_status(msg):
console_log(msg)
console_log("~" * (msg_length + 1))
console_log("")
def set_locale_encoding():
try:
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
except locale.Error as error:
print("Please ensure that the 'en_US.UTF-8' locale is available on your system.")
print("")
print("ERROR: ", error)
sys.exit(1)