| 51 | |
| 52 | |
| 53 | void Internat::Init() |
| 54 | { |
| 55 | // Save decimal point character |
| 56 | struct lconv * localeInfo = localeconv(); |
| 57 | if (localeInfo) |
| 58 | mDecimalSeparator = wxString(wxSafeConvertMB2WX(localeInfo->decimal_point)).GetChar(0); |
| 59 | |
| 60 | // wxLogDebug(wxT("Decimal separator set to '%c'"), mDecimalSeparator); |
| 61 | |
| 62 | // Setup list of characters that aren't allowed in file names |
| 63 | // Hey! The default wxPATH_NATIVE does not do as it should. |
| 64 | #if defined(__WXMAC__) |
| 65 | wxPathFormat format = wxPATH_MAC; |
| 66 | #elif defined(__WXGTK__) |
| 67 | wxPathFormat format = wxPATH_UNIX; |
| 68 | #elif defined(__WXMSW__) |
| 69 | wxPathFormat format = wxPATH_WIN; |
| 70 | #endif |
| 71 | |
| 72 | // This is supposed to return characters not permitted in paths to files |
| 73 | // or to directories |
| 74 | auto forbid = wxFileName::GetForbiddenChars(format); |
| 75 | |
| 76 | for (auto cc: forbid) { |
| 77 | #if defined(__WXGTK__) |
| 78 | if (cc == wxT('*') || cc == wxT('?')) { |
| 79 | continue; |
| 80 | } |
| 81 | #endif |
| 82 | exclude.push_back(wxString{ cc }); |
| 83 | } |
| 84 | |
| 85 | // The path separators may not be forbidden, so add them |
| 86 | //auto separators = wxFileName::GetPathSeparators(format); |
| 87 | |
| 88 | // Bug 1441 exclude all separators from filenames on all platforms. |
| 89 | auto separators = wxString("\\/"); |
| 90 | |
| 91 | for(auto cc: separators) { |
| 92 | if (forbid.Find(cc) == wxNOT_FOUND) |
| 93 | exclude.push_back(wxString{ cc }); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | void Internat::SetCeeNumberFormat() |
| 98 | { |