mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-02 16:43:03 +01:00
* strgutil.c (set_native_charset): Allow NULL as argument to use
nl_langinfo for selection. Mapped latin-15 to latin-1.
This commit is contained in:
parent
51ec578ba5
commit
f3484f7844
@ -1,3 +1,8 @@
|
|||||||
|
2002-09-02 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* strgutil.c (set_native_charset): Allow NULL as argument to use
|
||||||
|
nl_langinfo for selection. Mapped latin-15 to latin-1.
|
||||||
|
|
||||||
2002-08-30 Werner Koch <wk@gnupg.org>
|
2002-08-30 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* iobuf.c (block_filter): Removed the assert, so that one can pass
|
* iobuf.c (block_filter): Removed the assert, so that one can pass
|
||||||
|
@ -22,6 +22,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#ifdef HAVE_LANGINFO_CODESET
|
||||||
|
#include <langinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
@ -361,12 +365,27 @@ string_count_chr( const char *string, int c )
|
|||||||
int
|
int
|
||||||
set_native_charset( const char *newset )
|
set_native_charset( const char *newset )
|
||||||
{
|
{
|
||||||
if( !ascii_strcasecmp( newset, "iso-8859-1" ) ) {
|
if (!newset)
|
||||||
active_charset_name = "iso-8859-1";
|
#ifdef HAVE_LANGINFO_CODESET
|
||||||
|
newset = nl_langinfo (CODESET);
|
||||||
|
#else
|
||||||
|
newset = "8859-1";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (strlen (newset) > 3 && !ascii_memcasecmp (newset, "iso", 3)) {
|
||||||
|
newset += 3;
|
||||||
|
if (*newset == '-' || *newset == '_')
|
||||||
|
newset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !*newset
|
||||||
|
|| !ascii_strcasecmp (newset, "8859-1" )
|
||||||
|
|| !ascii_strcasecmp (newset, "8859-15" ) ) {
|
||||||
|
active_charset_name = "iso-8859-1";
|
||||||
no_translation = 0;
|
no_translation = 0;
|
||||||
active_charset = NULL;
|
active_charset = NULL;
|
||||||
}
|
}
|
||||||
else if( !ascii_strcasecmp( newset, "iso-8859-2" ) ) {
|
else if( !ascii_strcasecmp( newset, "8859-2" ) ) {
|
||||||
active_charset_name = "iso-8859-2";
|
active_charset_name = "iso-8859-2";
|
||||||
no_translation = 0;
|
no_translation = 0;
|
||||||
active_charset = latin2_unicode;
|
active_charset = latin2_unicode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user