View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027100 | Open CASCADE | OCCT:Foundation Classes | public | 2016-01-21 11:01 | 2016-01-22 20:09 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | no change required | ||
Platform | Linux | OS | RHEL | ||
Product Version | 6.3.1 | ||||
Summary | 0027100: OSD_Path missing constructor accepting path parameter as TCollection_ExtendedString | ||||
Description | OSD_Path supports paths containing Unicode symbols since 26514 issue implementation, it’ll be quite useful to have constructor accepting path parameter as TCollection_ExtendedString. Currently, having no this constructor user forced to convert the path to TCollection_AsciiString in order to create OSD_Path instance. In turn TCollection_AsciiString has constructor accepting TCollection_ExtendedString as input parameter and surely any user will use this fairly easy conversion approach, however, this approach is not acceptable for paths and will cause an inside OSD_Path error due to specific TCollection_AsciiString conversion method, instead it is essential to use ToUTF8CString() conversion method of TCollection_ExtendedString to make correct UTF-8 encoded string. As this approach is incomprehensible and nowhere documented, OSD_Path should implement constructor accepting path parameter as TCollection_ExtendedString and internally convert it to TCollection_AsciiString by the proper way making utilization of Unicode paths totally transparent to the user. | ||||
Additional information and documentation updates | WNT platforms has no need to make such special conversion through ToUTF8CString() method, instead it’s just enough TCollection_AsciiString constructor. | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
Alexey, in OCCT 7.0 constructor of TCollection_AsciiString from TCollection_ExtendedString with default second argument (0) will convert string to UTF-8 encoding using method ToUTF8CString() of the argument. This seems to be exactly what is needed, is that correct? If so, we seem to need nothing to do. |
|
Andrey, Seems yes, but not at all, I suppose further issue discussions are applicable for applications working in conjunction with Qt framework. So, to pass data from QString to TCollection_ExtendedString, when dealing with paths containing non-ascii symbols, we’ve found out that one cannot use the same approach for both Linux and WNT. Here is the internally developed macro called ‘QStringToCString’ we using for conversion QString to characters array: #ifdef WNT #define QStringToCString( src ) src.toLatin1().constData() #else #define QStringToCString( src ) src.toUtf8().constData() #endif As it can be seen from the code WNT platform using Latin1 method and Linux Utf8, methods transposition gives not acceptable conversion - perhaps it’s due to Qt internal issues. Consequently in order to properly convert TCollection_ExtendedString to TCollection_AsciiString, and then pass it to OSD_Path constructor, on Linux platforms it is essential to use ToUTF8CString() and on WNT just usual TCollection_AsciiString constructor with nonzero second argument. |
|
These troubles should be pertinent only for older OCCT versions, can you clarify if you experienced this with OCCT 6.9.x or 7.0, or earlier? |
|
Indeed in our case the problem comes from the Qt side and not OCC, so like when using toUtf8() method of QString on WNT we’re getting corrupted characters array. |
|
I am closing the issue since as we discussed current OCCT is believed to work fine with UTF8 encoding on all platforms |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-01-21 11:01 |
|
New Issue | |
2016-01-21 11:01 |
|
Assigned To | => abv |
2016-01-21 11:06 |
|
Relationship added | child of 0026514 |
2016-01-21 12:47 |
|
Target Version | Unscheduled => 7.0.0 |
2016-01-22 18:35 |
|
Note Added: 0050075 | |
2016-01-22 18:35 |
|
Assigned To | abv => adv |
2016-01-22 18:35 |
|
Status | new => feedback |
2016-01-22 19:37 |
|
Note Added: 0050082 | |
2016-01-22 19:37 |
|
Assigned To | adv => abv |
2016-01-22 19:37 |
|
Status | feedback => assigned |
2016-01-22 19:47 |
|
Note Added: 0050083 | |
2016-01-22 19:52 |
|
Note Added: 0050084 | |
2016-01-22 20:09 |
|
Note Added: 0050086 | |
2016-01-22 20:09 |
|
Status | assigned => closed |
2016-01-22 20:09 |
|
Resolution | open => no change required |
2016-01-22 20:09 |
|
Target Version | 7.0.0 => |