| 1 | # ifdef BOOST_WINDOWS_PATH
|
|---|
| 2 | // for BOOST_WINDOWS_PATH, convert alt_separator ('\') to separator
|
|---|
| 3 | ('/')
|
|---|
| 4 | bool is_alt_separator = (value == path_alt_separator<path_type>::value);
|
|---|
| 5 |
|
|---|
| 6 | if(std::string(std::setlocale(LC_ALL, "")).find(".950")){
|
|---|
| 7 | m_path += value;
|
|---|
| 8 | if(is_alt_separator){
|
|---|
| 9 | std::string::const_iterator it = m_path.end();
|
|---|
| 10 | --it; int lsb = *(it);
|
|---|
| 11 | --it; int msb = *(it);
|
|---|
| 12 | if(!detail::is_big5_char(0xff & msb, 0xff & lsb)){
|
|---|
| 13 | // not a part of the big5 char, patching it.
|
|---|
| 14 | *(--m_path.end()) = slash<path_type>::value;
|
|---|
| 15 | }
|
|---|
| 16 | }
|
|---|
| 17 | } else {
|
|---|
| 18 | m_path += ( is_alt_separator ? slash<path_type>::value: value );
|
|---|
| 19 | }
|
|---|
| 20 | # else
|
|---|
| 21 | m_path += value;
|
|---|
| 22 | m_path += value;
|
|---|
| 23 | # endif
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | // check two bytes could be a valid big5 char.
|
|---|
| 29 |
|
|---|
| 30 | bool is_big5_char(int msb, int lsb){
|
|---|
| 31 | bool ret = false;
|
|---|
| 32 | if(msb >= 0x81 && msb <= 0xfe){
|
|---|
| 33 | if(lsb >= 0x40 && lsb <= 0x7e){
|
|---|
| 34 | ret = true;
|
|---|
| 35 | }
|
|---|
| 36 | if(lsb >= 0xa1 && lsb <= 0xfe){
|
|---|
| 37 | ret = true;
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|
| 40 | return ret;
|
|---|
| 41 | }
|
|---|