File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed
Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ int main(int argc, char* argv[]) {
5656 }
5757 }
5858
59+ std::setlocale (LC_ALL, " C.UTF-8" );
5960 // Load cookies and settings
6061 auto & conf = AppConfig::instance ();
6162 if (!conf.init ()) {
Original file line number Diff line number Diff line change @@ -104,19 +104,9 @@ std::string AppVersion::getDeviceName() {
104104 return name.data ();
105105 }
106106#elif defined(__linux__)
107- static const char * dev_names[] = {
108- " /sys/devices/virtual/dmi/id/product_name" ,
109- " /sys/devices/virtual/dmi/id/board_name" ,
110- " /sys/firmware/devicetree/base/model" ,
111- };
112- for (size_t i = 0 ; i < sizeof (dev_names); i++) {
113- std::ifstream f (dev_names[i]);
114- if (f.is_open ()) {
115- std::string name;
116- std::getline (f, name);
117- while (!std::isprint (name.back ())) name.pop_back ();
118- if (name.size () > 0 ) return name;
119- }
107+ char name[256 ];
108+ if (!gethostname (name, sizeof (name))) {
109+ return name;
120110 }
121111#endif
122112 return fmt::format (" {} for {}" , getPackageName (), getPlatform ());
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ MPVCore::MPVCore() {
112112}
113113
114114void MPVCore::init () {
115- setlocale (LC_NUMERIC, " C" );
115+ std:: setlocale (LC_NUMERIC, " C" );
116116#ifdef ANDROID
117117 auto env = static_cast <JNIEnv *>(SDL_AndroidGetJNIEnv ());
118118 if (!env->GetJavaVM (&g_vm) && g_vm) av_jni_set_java_vm (g_vm, NULL );
You can’t perform that action at this time.
0 commit comments