View Issue Details

IDProjectCategoryView StatusLast Update
0031171Open CASCADEOCCT:DRAWpublic2020-12-02 17:12
ReporterabvAssigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.4.0 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031171: Draw - support Unicode input / output in console on Windows
DescriptionCurrently DRAW is not configured properly to deal with Unicode symbols when working interactively on Windows. When Unicode text is used in command or output, in most cases either the text is output corrupted, or output pipeline gets blocked.

This can be fixed now for Windows 10 since it supports UTF8 codepage (65001).
Steps To ReproduceNote: to be able to see non-Ascii symbols, make sure that the font used by the console supports these symbols. For the examples below, to be able to show hieroglyphs in the Windows' command window, I had to go to properties of the window, and on tab "Font" select "NSimSun" or "SimSun-ExtB" font.

Method A: the following DRAW command should output hierogliphs in file name, translated to Chinese as "it works":

test bugs fclasses bug22125 -echo

Method B: the following commands defines Korean text translated as "triangulation", sets it as name to OCAF label and prints name from OCAF; hierogliphs should be correct at both places (see attached image):

pload ALL
set n [encoding convertfrom utf-8 "\xec\x82\xbc\xea\xb0\x81\x20\xeb\xb6\x84\xed\x95\xa0"]
NewDocument D
SetName D 0:1 $n
GetName D 0:1
TagsNo tags attached.
Test case numberbugs/fclasses/bug22125

Attached Files

  • bug31171_fixed.png (13,731 bytes)

Relationships

related to 0014673 closedbugmaster Open CASCADE Provide true support for Unicode symbols 

Activities

abv

2019-11-16 15:37

manager  

bug31171_fixed.png (13,731 bytes)

git

2019-11-16 16:45

administrator   ~0089017

Branch CR31171 has been created by abv.

SHA-1: 5201e76f6fc96e61b595a2999385fd599de21c1a


Detailed log of new commits:

Author: abv
Date: Sat Nov 16 08:59:38 2019 +0300

    0031171: Draw - support Unicode input / output in console on Windows
    
    System console is configured at DRAW start to use UTF-8 encoding, for cout and cin to deal correctly with Unicode symbols.
    Use of std::wcout is avoided as it leads to corrupted output.
    
    Command testgrid is improved to enforce UTF-8 encoding in child DRAW processes to preserve Unicode symbols in captured output.
    
    Test bugs fclasses bug22125 is refactored:
    - avoid dependency on external data file
    - avoid producing snapshot
    - check that Unicode name of the file created by OCCT procedure matches the name interpreted by Tcl functions

git

2019-11-16 18:44

administrator   ~0089028

Branch CR31171 has been updated forcibly by abv.

SHA-1: 68eb42b5ada60de52935583b8152445715075d77

abv

2019-11-16 18:45

manager   ~0089029

The fix is pushed to branch CR31171 and tested, see Jenkins job CR31171-abv; please review

git

2019-11-16 19:56

administrator   ~0089030

Branch CR31171 has been updated forcibly by abv.

SHA-1: 660c58f42ba69ae29c36edbefb556ae07b2cff1c

abv

2019-11-16 19:56

manager   ~0089031

Rebased on new master

kgv

2019-11-17 11:34

developer   ~0089032

--- a/src/Draw/Draw_Main.cxx
+++ b/src/Draw/Draw_Main.cxx
@@ -1,4 +1,4 @@
-// Created on: 1999-12-30
+\feff// Created on: 1999-12-30

Why BOM is suddenly needed here?

abv

2019-11-17 16:28

manager   ~0089033

Oops, my mistake

git

2019-11-17 17:54

administrator   ~0089034

Branch CR31171 has been updated forcibly by abv.

SHA-1: 8f00325d73ba7521020db6e201786eaeab48cb75

abv

2019-11-17 17:56

manager   ~0089035

Encoding of Draw_Main.cxx is corrected; alas the tools I normally use for viewing diffs do not show the changes in BOM...

bugmaster

2019-11-20 17:05

administrator   ~0089104

Combination -
OCCT branch : WEEK-47
master SHA - 01ba59e958df3e8d3e19f5705a6e40d5574ee0c3
5f5b1aed1c6e139bbd34314eca77ae7abcd8895c
Products branch : WEEK-47 SHA - 0585a8b491d06a1c800faf77c3b79decb046c24f
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16830.62000000013 / 16823.120000000046 [+0.04%]
Products
Total CPU difference: 10816.570000000062 / 10787.080000000053 [+0.27%]
Windows-64-VC14:
OCCT
Total CPU difference: 18301.015625 / 18299.59375 [+0.01%]
Products
Total CPU difference: 12814.90625 / 12853.21875 [-0.30%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2019-11-24 11:35

administrator   ~0089181

Branch CR31171 has been deleted by inv.

SHA-1: 8f00325d73ba7521020db6e201786eaeab48cb75

Related Changesets

occt: master 8f00325d

2019-11-16 05:59:38

abv


Committer: abv Details Diff
0031171: Draw - support Unicode input / output in console on Windows

System console is configured at DRAW start to use UTF-8 encoding, for cout and cin to deal correctly with Unicode symbols.
Use of std::wcout is avoided as it leads to corrupted output.

Command testgrid is improved to enforce UTF-8 encoding in child DRAW processes to preserve Unicode symbols in captured output.

Test bugs fclasses bug22125 is refactored:
- avoid dependency on external data file
- avoid producing snapshot
- check that Unicode name of the file created by OCCT procedure matches the name interpreted by Tcl functions
Affected Issues
0031171
mod - src/Draw/CommandWindow.cxx Diff File
mod - src/Draw/Draw.cxx Diff File
mod - src/Draw/Draw_Interpretor.cxx Diff File
mod - src/Draw/Draw_Main.cxx Diff File
mod - src/DrawResources/TestCommands.tcl Diff File
mod - tests/bugs/fclasses/bug22125 Diff File

Issue History

Date Modified Username Field Change
2019-11-16 08:51 abv New Issue
2019-11-16 08:51 abv Assigned To => apn
2019-11-16 15:36 abv Steps to Reproduce Updated
2019-11-16 15:37 abv Relationship added related to 0014673
2019-11-16 15:37 abv File Added: bug31171_fixed.png
2019-11-16 15:43 abv Steps to Reproduce Updated
2019-11-16 15:44 abv Description Updated
2019-11-16 16:45 git Note Added: 0089017
2019-11-16 18:44 git Note Added: 0089028
2019-11-16 18:45 abv Note Added: 0089029
2019-11-16 18:45 abv Status new => resolved
2019-11-16 18:45 abv Assigned To apn => kgv
2019-11-16 19:56 git Note Added: 0089030
2019-11-16 19:56 abv Note Added: 0089031
2019-11-17 11:34 kgv Note Added: 0089032
2019-11-17 16:28 abv Note Added: 0089033
2019-11-17 17:54 git Note Added: 0089034
2019-11-17 17:56 abv Note Added: 0089035
2019-11-18 11:44 kgv Assigned To kgv => bugmaster
2019-11-18 11:44 kgv Status resolved => reviewed
2019-11-18 11:44 kgv Product Version => 7.4.0
2019-11-18 19:17 bugmaster Test case number => bugs/fclasses/bug22125
2019-11-20 17:05 bugmaster Note Added: 0089104
2019-11-20 17:05 bugmaster Status reviewed => tested
2019-11-24 11:21 abv Changeset attached => occt master 8f00325d
2019-11-24 11:21 abv Assigned To bugmaster => abv
2019-11-24 11:21 abv Status tested => verified
2019-11-24 11:21 abv Resolution open => fixed
2019-11-24 11:35 git Note Added: 0089181
2020-12-02 16:41 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed