Changeset 236 for branches/samba-3.0


Ignore:
Timestamp:
May 29, 2009, 8:04:03 AM (17 years ago)
Author:
Herwig Bauernfeind
Message:

Fix for Ticket #85 (by diver)

Location:
branches/samba-3.0/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/lib/charcnv.c

    r165 r236  
    5656{
    5757        const char *ret = NULL;
    58 
     58#ifndef __OS2__
    5959        if (ch == CH_UTF16LE) ret = "UTF-16LE";
    6060        else if (ch == CH_UTF16BE) ret = "UTF-16BE";
     61
     62
     63
     64
    6165        else if (ch == CH_UNIX) ret = lp_unix_charset();
    6266        else if (ch == CH_DOS) ret = lp_dos_charset();
     
    8993
    9094        if (!ret || !*ret) ret = "ASCII";
     95
    9196        return ret;
    9297}
     
    392397                return 0;
    393398
     399
     400
    394401        if (from != CH_UTF16LE && from != CH_UTF16BE && to != CH_UTF16LE && to != CH_UTF16BE) {
    395402                const unsigned char *p = (const unsigned char *)src;
     
    399406                unsigned char lastp = '\0';
    400407                size_t retval = 0;
     408
     409
    401410
    402411                /* If all characters are ascii, fast path here. */
     
    427436                }
    428437                return retval;
     438
     439
    429440        } else if (from == CH_UTF16LE && to != CH_UTF16LE) {
    430441                const unsigned char *p = (const unsigned char *)src;
     
    463474                }
    464475                return retval;
     476
     477
    465478        } else if (from != CH_UTF16LE && from != CH_UTF16BE && to == CH_UTF16LE) {
    466479                const unsigned char *p = (const unsigned char *)src;
     
    580593
    581594 again:
     595
     596
     597
    582598
    583599        retval = smb_iconv(descriptor,
  • branches/samba-3.0/source/param/loadparm.c

    r165 r236  
    14651465        string_set(&Globals.unix_charset, DEFAULT_UNIX_CHARSET);
    14661466#else
    1467         /* On OS/2, using UTF8 causes problems with display of foreign characters - default to SYSTEM codepage */
    1468         string_set(&Globals.unix_charset, "SYSTEM");
     1467        /* On OS/2, using UTF8 causes problems with display of foreign
     1468           characters - default to IBM-850 codepage */
     1469        string_set(&Globals.unix_charset, "IBM-850");
    14691470#endif
    14701471
     
    14721473        /* If the system supports nl_langinfo(), try to grab the value
    14731474           from the user's locale */
     1475
     1476
    14741477        string_set(&Globals.display_charset, "LOCALE");
     1478
     1479
     1480
     1481
     1482
     1483
    14751484#else
    14761485        string_set(&Globals.display_charset, DEFAULT_DISPLAY_CHARSET);
     
    14811490        string_set(&Globals.dos_charset, DEFAULT_DOS_CHARSET);
    14821491#else
    1483         /* On OS/2, using UTF8 causes problems with display of foreign characters - default to SYSTEM codepage */
    1484         string_set(&Globals.dos_charset, "SYSTEM");
     1492        /* On OS/2, using UTF8 causes problems with display of foreign
     1493           characters - default to IBM-850 codepage */
     1494        string_set(&Globals.dos_charset, "IBM-850");
    14851495#endif
    14861496        /*
Note: See TracChangeset for help on using the changeset viewer.