[SERVER-8353] Mongo shell in Windows running under Console2 complains wrongly about unicode font Created: 27/Jan/13 Updated: 20/Nov/13 Resolved: 04/Nov/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Gorm Eriksen | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: | 1. Install console2 (2.0.0 148 beta 32b is the one I tested) - http://sourceforge.net/projects/console/ |
| Participants: |
| Description |
|
I have an issue with mongo shell reporting that a non-unicode font is used, even though console2 is configured to use consolas or Lucida Console Note that it works well when running outside console2, so it's likely there the problem lay, but reporting it here first to see if there is anything that could be done differently in mongo. If not, I will take the bug to console2, but would appreciate any available help in reporting it. When I type a unicode characther (e.g. æøå) this is what happens: C:\Program Files\Console2>mongo ├© – |
| Comments |
| Comment by Gorm Eriksen [ 28/Jan/13 ] | ||||||||||||||||||||||
|
' What version of Windows are you running? Windows 7 Ultimate 64b ' What language are you set for? Using English windows
Norwegian
Yes, English with US keyboard and Norwegian with Norwegian keyboard beneath, Norwegian configured as default.
Yes
I have tried both the special unicode chars and alt combination. Mongo shell exists at once.
Active code page: 850 Same when I do it regular Windows Command Prompt. | ||||||||||||||||||||||
| Comment by Tad Marshall [ 28/Jan/13 ] | ||||||||||||||||||||||
| ||||||||||||||||||||||
| Comment by Gorm Eriksen [ 28/Jan/13 ] | ||||||||||||||||||||||
|
I'm afraid I don't have more info. I tried with a freshly installed console2, and it exits here. However, I'm very glad you took a look at it, and if it works on your machine, considering it's a very edge case that one can easily work around, it's best to just close it. Thank you for your help! Btw: this is how the test looks on my end. As soon as I write an unicode char it exit: C:\temp\c2\Console2>ø æ å C:\temp\c2\Console2>mongo --nodb ├ª | ||||||||||||||||||||||
| Comment by Tad Marshall [ 27/Jan/13 ] | ||||||||||||||||||||||
|
Hi Gorm, I tried a quick test, and I can't reproduce your problem. I downloaded Console2 as Console-2.00b148-Beta_32bit.zip and MongoDB as mongodb-win32-x86_64-2.2.2.zip and tested in Windows 7 Home Premium 64-bit set to US English with Console2's default Courier New and with Consolas. Unicode is working for me. I typed a few Unicode characters using Alt-+ and hex codes (00E1, 00E2, and others) and copied and pasted your text from the Jira ticket. No error message and the text shows up fine.
Can you provide additional information for me to reproduce your problem? Thanks! Tad | ||||||||||||||||||||||
| Comment by Tad Marshall [ 27/Jan/13 ] | ||||||||||||||||||||||
|
Hi Gorm, Thanks for the report. I had not heard of Console2, but since you provided the link to SourceForge I assume that this will be fully debuggable. For reference, here is the code that is complaining: (excerpt from writeUtf8ToWindowsConsole() in src/mongo/util/text.cpp)
As you can see, there is no actual checking for what font is set in your terminal (console) program; all we know for sure is that our attempt to use WriteConsoleW() failed with ERROR_GEN_FAILURE. In testing, this seemed to only happen when we tried to display non-ASCII test when an OEM font had been selected, which is why the error message says what it does. In general, we really only support the Windows console. There are known problems with running in a Cygwin window, for example, and these are treated as low priority and generally "not our bug". Console2 may be in the same category, but we can see if there is a simple fix to either the mongo shell or Console2. Tad |