mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Minor tweaks plus added method for parsing mime headers.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26109 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eb73c50d13
commit
726b05507e
7 changed files with 164 additions and 95 deletions
|
@ -2022,6 +2022,9 @@ GSPrivateDefaultCStringEncoding()
|
|||
if (defEnc == GSUndefinedEncoding)
|
||||
{
|
||||
char *encoding;
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
char encbuf[BUFSIZ];
|
||||
#endif
|
||||
unsigned int count;
|
||||
|
||||
GSSetupEncodingTable();
|
||||
|
@ -2035,10 +2038,16 @@ GSPrivateDefaultCStringEncoding()
|
|||
|
||||
if (natEnc == GSUndefinedEncoding)
|
||||
{
|
||||
|
||||
/* Encoding not set */
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
/* Take it from the system locale information. */
|
||||
encoding = nl_langinfo(CODESET);
|
||||
[gnustep_global_lock lock];
|
||||
strncpy(encbuf, nl_langinfo(CODESET), sizeof(encbuf)-1);
|
||||
[gnustep_global_lock unlock];
|
||||
encbuf[sizeof(encbuf)-1] = '\0';
|
||||
encoding = encbuf;
|
||||
|
||||
/*
|
||||
* First handle the fallback response from nl_langinfo() ...
|
||||
* if we are getting the default value we can't assume that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue