src/stdlib/SDL_iconv.c
changeset 2183 9f31740cad2e
parent 2182 cc2597da0840
child 2184 8f8516e79a13
equal deleted inserted replaced
2182:cc2597da0840 2183:9f31740cad2e
   796     return 0;
   796     return 0;
   797 }
   797 }
   798 
   798 
   799 #endif /* !HAVE_ICONV */
   799 #endif /* !HAVE_ICONV */
   800 
   800 
   801 static const char *
       
   802 getlocale()
       
   803 {
       
   804     const char *lang;
       
   805 
       
   806     lang = SDL_getenv("LC_ALL");
       
   807     if (!lang) {
       
   808         lang = SDL_getenv("LC_CTYPE");
       
   809     }
       
   810     if (!lang) {
       
   811         lang = SDL_getenv("LC_MESSAGES");
       
   812     }
       
   813     if (!lang) {
       
   814         lang = SDL_getenv("LANG");
       
   815     }
       
   816     if (!lang || SDL_strcmp(lang, "C") == 0) {
       
   817         lang = "ASCII";
       
   818     }
       
   819     return lang;
       
   820 }
       
   821 
       
   822 char *
   801 char *
   823 SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf,
   802 SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf,
   824                  size_t inbytesleft)
   803                  size_t inbytesleft)
   825 {
   804 {
   826     SDL_iconv_t cd;
   805     SDL_iconv_t cd;