On Sun, Jul 08, 2007 at 04:22:29AM +0900, Koji Yokota wrote:
> Enrico Forestieri wrote:
> > On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:
> >
> >> On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:
> >>
> >>> but crash also happens when I start it with
> >>>
> >>> > env LC_ALL=C lyx
> >>>
> >>> In this case, there are no such complaints.
> >> Yes, the C locale is always supported. The crash is due to missing
> >> support for wchar_t, meaning that even the C locale can't deal with
> >> wide characters. Please try the patch I sent you.
> >
> > Strange. I still don't see on the list the mail with the patch, so
> > I am resending it attached here.
>
> Indeed the problem seems around here. The patch solved the problem when
> I start lyx with LC_ALL=C.
>
> However, when it is started with ja_JP locale for example, it still
> crashes with complaints:
>
> > terminate called after throwing an instance of 'std::runtime_error'
> > what(): locale::facet::_S_create_c_locale name not valid
> > Abort (damped core)
>
> A little more modification may be necessary.
This occurs when the locale itself is not supported and I also get it
on cygwin. Please, try the attached patch, which should definitely
solve the issue.
--
Enrico
Index: src/frontends/controllers/frontend_helpers.cpp
===================================================================
--- src/frontends/controllers/frontend_helpers.cpp (revision 18988)
+++ src/frontends/controllers/frontend_helpers.cpp (working copy)
@@ -1108,6 +1108,12 @@ class Sorter
LanguagePair, bool>
{
public:
+#if !defined(USE_WCHAR_T) && defined(__GNUC__)
+ bool operator()(LanguagePair const & lhs,
+ LanguagePair const & rhs) const {
+ return lhs.first < rhs.first;
+ }
+#else
Sorter() : loc_("") {};
bool operator()(LanguagePair const & lhs,
LanguagePair const & rhs) const {
@@ -1115,6 +1121,7 @@ public:
}
private:
std::locale loc_;
+#endif
};
} // namespace anon