Search the web
Sign In
New User? Sign Up
vim · Vim (Vi IMproved) text editor users list

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

  Messages Help
Advanced
Very bad smell in MSVCRT (Was: Re: Details of the crash caused by "   Message List  
Reply Message #62451 of 131364 |
Re: Very bad smell in MSVCRT (Was: Re: Details of the crash caused by "language messages zh_CN.UTF-8")


Yongwei wrote:

> >> I am mentioning this again, because I applied the following patch in
> >> May and have not encountered any problems since then (only _WIN32 is
> >> tested). Maybe it can be accepted now?
> >>
> >>
> ========================================================================
> >> --- main.c.orig Mon Sep 26 13:49:52 2005
> >> +++ main.c Mon Sep 26 14:04:18 2005
> >> @@ -218,6 +218,9 @@
> >> * work until set_init_1() has been called!
> >> */
> >> setlocale(LC_ALL, "");
> >> +#if defined(_WIN32) || defined(_WIN64)
> >> + setlocale(LC_CTYPE, "C");
> >> +#endif
> >>
> >> # ifdef FEAT_GETTEXT
> >> {
> >>
> ========================================================================
> >
> > OK, let's include it now and await any problem reports.
> >
> > For completeness this also has to be added, for the ":language"
> > command:
> >
> > [snipped]
>
> Hi, Bram, I did not see an official patch appear regarding this issue,
> so I am asking here again. Do you think it good enough now? Can it
> enter 6.4?
>
> I have currently the patch applied as attached --- in case you forgot
> where you put your old and unapplied patches :-). No problems are found
> and everything is OK.

This is a change in Vim 7, it has been included in the latest
snapshots.

I don't want to include this in Vim 6.4, the risk that it breaks
something is too big.

--
BEDEVERE: And that, my lord, is how we know the Earth to be banana-shaped.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///



Sat Oct 8, 2005 12:01 pm

Bram@...
Send Email Send Email

Message #62451 of 131364 |
Expand Messages Author Sort by Date

A really, really disgusting thing seems there in there MSVCRT code. After I built Vim with DEBUG=yes, I found strange crashes and assertions in _output, which...
adah@... Send Email May 16, 2005
5:10 pm

... [...] Sigh indeed! This "bad smell" is not going to be a selling argument for Vim in Eastern Asia. ... 5) Check each string for legality in the current...
A. J. Mechelynck
antoine.mechelynck@... Send Email
May 16, 2005
5:28 pm

Some more comments now. Now I am thinking the Microsoft approach is theoretically correct. Just as I was taking the shower before going to bed, I realized...
adah@... Send Email May 17, 2005
3:28 am

Hi Bram, How is it going on this? I am now thinking you could execute a setlocale on "set encoding=...". The language_country part can omitted. My tests show...
adah@... Send Email May 23, 2005
6:38 am

... What would Vim do with this? How can Vim guess what to search for? The basic idea is that the locale comes from the enviroment and everything works...
Bram Moolenaar
Bram@... Send Email
May 23, 2005
9:32 am

Hi Bram, I do not mind using English messages (which is exactly what I am doing now). However, one must confess it is not ideal that on a Far East Windows ...
adah@... Send Email May 23, 2005
10:51 am

... Using translate messages with utf-8 should work. And as far as I know it does work. ... I have no experience with an actual Asian locale on MS-Windows....
Bram Moolenaar
Bram@... Send Email
May 23, 2005
12:48 pm

... No, it does not on Far East Windows systems with default locale settings. Nor does it on other version of Windows if the user changes all the locale...
adah@... Send Email May 24, 2005
2:15 am

... This in fact changed between C standards. Thus it's impossible to write code that works with every compiler/library. Same applies to the backslash, which...
Bram Moolenaar
Bram@... Send Email
May 24, 2005
9:45 am

... Or change the program appropriately. Some time ago I changed something like this if (str[len - 1] == '\\') to if (_tcsrchr(str, '\\') == str + len - 1) ...
adah@... Send Email May 24, 2005
10:47 am

... No, you cannot solve it that way. The C89 compiler will recognize the backslash in a trail byte as a backslash, the C99 compiler doesn't, it sees one...
Bram Moolenaar
Bram@... Send Email
May 24, 2005
11:14 am

adah@... wrote: [...] ... I think I can answer that one. There is no single "exclusive" standard way of building Vim on Windows. The following are...
A. J. Mechelynck
antoine.mechelynck@... Send Email
May 24, 2005
11:22 am

... I am mentioning this again, because I applied the following patch in May and have not encountered any problems since then (only _WIN32 is tested). Maybe...
adah@... Send Email Sep 26, 2005
6:11 am

... OK, let's include it now and await any problem reports. For completeness this also has to be added, for the ":language" command: ... *************** ... *...
Bram Moolenaar
Bram@... Send Email
Sep 26, 2005
7:47 am

... From: <adah@...> To: <vim@...> Sent: Monday, September 26, 2005 8:03 AM Subject: Re: Very bad smell in MSVCRT (Was: Re: Details of the crash...
Tony Mechelynck
antoine.mechelynck@... Send Email
Sep 26, 2005
6:36 am

... Thanks, Tony. However, Vim would not have crashed if I had simply used `set LANG=en'. The point of this patch is exactly to make Vim work with Chinese...
adah@... Send Email Sep 26, 2005
7:49 am

... this ... when ... the ... Just one side comment: Remove the _WIN64 part of my patch, or add it to yours. :-) Best regards, Yongwei...
adah@... Send Email Sep 26, 2005
7:58 am

... WIN32 is always defined for MS-Windows 95 and above (in the makefile). Also for 64 bit windows. There is also WIN3264, but its use is a bit inconsistent. ...
Bram Moolenaar
Bram@... Send Email
Sep 26, 2005
9:50 am

... Ah, I did not know it, and you were right (partly). However, I believe it is _WIN32 (not WIN32) that is universally defined. See the MSDN page: ...
adah@... Send Email Sep 27, 2005
2:29 am

... Hi, Bram, I did not see an official patch appear regarding this issue, so I am asking here again. Do you think it good enough now? Can it enter 6.4? I...
adah@... Send Email Oct 8, 2005
5:16 am

... This is a change in Vim 7, it has been included in the latest snapshots. I don't want to include this in Vim 6.4, the risk that it breaks something is too...
Bram Moolenaar
Bram@... Send Email
Oct 8, 2005
12:00 pm

... Highly as I respect your opinions, I want to try again to persuade you on this issue: 1) The risk is small. It mainly affects the is* functions and the...
adah@... Send Email Oct 9, 2005
3:56 am

... If you are still doubting about the risk (yes, the doubt is reasonable), may I suggest some mechanisms that is safer? The pseudo-code is as follows: ...
adah@... Send Email Oct 14, 2005
3:00 am

... If there are any problems with calling setlocale() then this code would restrict it to a smaller group of users. But the problems would still be there. ...
Bram Moolenaar
Bram@... Send Email
Oct 14, 2005
10:08 am

... Missed one thing: set_encoding(a:encoding) { ... encoding = a:encoding; #ifdef _WIN32 check_locale(); #endif } Best regards, Yongwei...
adah@... Send Email Oct 14, 2005
3:37 am

... Agreed. I was not intending it for 6.4.000 either. Just want to show some safer way: My test shows that MSVCRT make no difference between a UTF-8 locale...
adah@... Send Email Oct 14, 2005
2:24 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help