~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to src/os_win32.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-01-13 18:39:18 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090113183918-kgq1jzdwsbbex4pq
Tags: 2:7.2.079-1ubuntu1
* Resynchronise with Debian (diversions fix closes LP: #296324). Remaining
  changes:
  - runtime/syntax/debcontrol.vim:
    + Add "metapackages" to the list of valid sections.
  - runtime/syntax/debchangelog.vim:
    + Add "jaunty" to the list of valid suites.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
  - runtime/syntax/debsources.vim:
    + Add "jaunty" to debsourcesDistrKeyword
  - runtime/syntax/grub.vim:
    + Add Ubuntu-specific 'quiet' keyword.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1587
1587
#ifdef FEAT_MBYTE
1588
1588
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
1589
1589
    {
1590
 
        WCHAR   *p = enc_to_ucs2(name, NULL);
 
1590
        WCHAR   *p = enc_to_utf16(name, NULL);
1591
1591
        WCHAR   fnamew[_MAX_PATH];
1592
1592
        WCHAR   *dumw;
1593
1593
        long    n;
2440
2440
 
2441
2441
        if (GetCurrentDirectoryW(_MAX_PATH, wbuf) != 0)
2442
2442
        {
2443
 
            char_u  *p = ucs2_to_enc(wbuf, NULL);
 
2443
            char_u  *p = utf16_to_enc(wbuf, NULL);
2444
2444
 
2445
2445
            if (p != NULL)
2446
2446
            {
2466
2466
#ifdef FEAT_MBYTE
2467
2467
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
2468
2468
    {
2469
 
        WCHAR   *p = enc_to_ucs2(name, NULL);
 
2469
        WCHAR   *p = enc_to_utf16(name, NULL);
2470
2470
        long    n;
2471
2471
 
2472
2472
        if (p != NULL)
2495
2495
#ifdef FEAT_MBYTE
2496
2496
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
2497
2497
    {
2498
 
        WCHAR   *p = enc_to_ucs2(name, NULL);
 
2498
        WCHAR   *p = enc_to_utf16(name, NULL);
2499
2499
        long    n;
2500
2500
 
2501
2501
        if (p != NULL)
2522
2522
    WCHAR       *p = NULL;
2523
2523
 
2524
2524
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
2525
 
        p = enc_to_ucs2(name, NULL);
 
2525
        p = enc_to_utf16(name, NULL);
2526
2526
#endif
2527
2527
 
2528
2528
#ifdef FEAT_MBYTE
2590
2590
    WCHAR       *wn = NULL;
2591
2591
 
2592
2592
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
2593
 
        wn = enc_to_ucs2(fname, NULL);
 
2593
        wn = enc_to_utf16(fname, NULL);
2594
2594
    if (wn != NULL)
2595
2595
    {
2596
2596
        hFile = CreateFileW(wn,         /* file name */
4239
4239
 
4240
4240
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
4241
4241
    {
4242
 
        wn = enc_to_ucs2(name, NULL);
 
4242
        wn = enc_to_utf16(name, NULL);
4243
4243
        if (wn != NULL)
4244
4244
        {
4245
4245
            SetFileAttributesW(wn, FILE_ATTRIBUTE_NORMAL);
4382
4382
 
4383
4383
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
4384
4384
    {
4385
 
        wold = enc_to_ucs2((char_u *)pszOldFile, NULL);
4386
 
        wnew = enc_to_ucs2((char_u *)pszNewFile, NULL);
 
4385
        wold = enc_to_utf16((char_u *)pszOldFile, NULL);
 
4386
        wnew = enc_to_utf16((char_u *)pszNewFile, NULL);
4387
4387
        if (wold != NULL && wnew != NULL)
4388
4388
            retval = mch_wrename(wold, wnew);
4389
4389
        vim_free(wold);
4492
4492
    WCHAR       *wn = NULL;
4493
4493
 
4494
4494
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
4495
 
        wn = enc_to_ucs2(n, NULL);
 
4495
        wn = enc_to_utf16(n, NULL);
4496
4496
#endif
4497
4497
 
4498
4498
    if (mch_isdir(n))
4618
4618
 
4619
4619
#if defined(FEAT_MBYTE) || defined(PROTO)
4620
4620
/*
4621
 
 * Version of open() that may use ucs2 file name.
 
4621
 * Version of open() that may use UTF-16 file name.
4622
4622
 */
4623
4623
    int
4624
4624
mch_open(char *name, int flags, int mode)
4630
4630
 
4631
4631
    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
4632
4632
    {
4633
 
        wn = enc_to_ucs2(name, NULL);
 
4633
        wn = enc_to_utf16(name, NULL);
4634
4634
        if (wn != NULL)
4635
4635
        {
4636
4636
            f = _wopen(wn, flags, mode);
4648
4648
}
4649
4649
 
4650
4650
/*
4651
 
 * Version of fopen() that may use ucs2 file name.
 
4651
 * Version of fopen() that may use UTF-16 file name.
4652
4652
 */
4653
4653
    FILE *
4654
4654
mch_fopen(char *name, char *mode)
4675
4675
        else if (newMode == 'b')
4676
4676
            _set_fmode(_O_BINARY);
4677
4677
# endif
4678
 
        wn = enc_to_ucs2(name, NULL);
4679
 
        wm = enc_to_ucs2(mode, NULL);
 
4678
        wn = enc_to_utf16(name, NULL);
 
4679
        wm = enc_to_utf16(mode, NULL);
4680
4680
        if (wn != NULL && wm != NULL)
4681
4681
            f = _wfopen(wn, wm);
4682
4682
        vim_free(wn);
4776
4776
    int                 len;
4777
4777
 
4778
4778
    /* Convert the file names to wide characters. */
4779
 
    fromw = enc_to_ucs2(from, NULL);
4780
 
    tow = enc_to_ucs2(to, NULL);
 
4779
    fromw = enc_to_utf16(from, NULL);
 
4780
    tow = enc_to_utf16(to, NULL);
4781
4781
    if (fromw != NULL && tow != NULL)
4782
4782
    {
4783
4783
        /* Open the file for reading. */
5122
5122
    for (i = 0; i < used_file_count; ++i)
5123
5123
    {
5124
5124
        idx = used_file_indexes[i];
5125
 
        str = ucs2_to_enc(ArglistW[idx], NULL);
 
5125
        str = utf16_to_enc(ArglistW[idx], NULL);
5126
5126
        if (str != NULL)
5127
5127
        {
5128
5128
#ifdef FEAT_DIFF