Ticket #6635: 6635.patch
File 6635.patch, 2.6 KB (added by , 11 years ago) |
---|
-
boost/locale/utf.hpp
280 280 template<typename Iterator> 281 281 static Iterator encode(code_point value,Iterator out) 282 282 { 283 if(value <= 0x7F) {284 *out++ = value;283 if(value <= 0x7F) { 284 *out++ = static_cast<char_type>(value); 285 285 } 286 else if(value <= 0x7FF) {287 *out++ =(value >> 6) | 0xC0;288 *out++ =(value & 0x3F) | 0x80;286 else if(value <= 0x7FF) { 287 *out++ = static_cast<char_type>((value >> 6) | 0xC0); 288 *out++ = static_cast<char_type>((value & 0x3F) | 0x80); 289 289 } 290 else if(BOOST_LOCALE_LIKELY(value <= 0xFFFF)) {291 *out++ =(value >> 12) | 0xE0;292 *out++ =((value >> 6) & 0x3F) | 0x80;293 *out++ =(value & 0x3F) | 0x80;290 else if(BOOST_LOCALE_LIKELY(value <= 0xFFFF)) { 291 *out++ = static_cast<char_type>((value >> 12) | 0xE0); 292 *out++ = static_cast<char_type>(((value >> 6) & 0x3F) | 0x80); 293 *out++ = static_cast<char_type>((value & 0x3F) | 0x80); 294 294 } 295 295 else { 296 *out++ =(value >> 18) | 0xF0;297 *out++ =((value >> 12) & 0x3F) | 0x80;298 *out++ =((value >> 6) & 0x3F) | 0x80;299 *out++ =(value & 0x3F) | 0x80;296 *out++ = static_cast<char_type>((value >> 18) | 0xF0); 297 *out++ = static_cast<char_type>(((value >> 12) & 0x3F) | 0x80); 298 *out++ = static_cast<char_type>(((value >> 6) & 0x3F) | 0x80); 299 *out++ = static_cast<char_type>((value & 0x3F) | 0x80); 300 300 } 301 301 return out; 302 302 } … … 380 380 static It encode(code_point u,It out) 381 381 { 382 382 if(BOOST_LOCALE_LIKELY(u<=0xFFFF)) { 383 *out++ = u;383 *out++ = static_cast<char_type>(u); 384 384 } 385 385 else { 386 u -=0x10000;387 *out++ =0xD800 | (u>>10);388 *out++ =0xDC00 | (u & 0x3FF);386 u -= 0x10000; 387 *out++ = static_cast<char_type>(0xD800 | (u>>10)); 388 *out++ = static_cast<char_type>(0xDC00 | (u & 0x3FF)); 389 389 } 390 390 return out; 391 391 } … … 434 434 template<typename It> 435 435 static It encode(code_point u,It out) 436 436 { 437 *out++ = u;437 *out++ = static_cast<char_type>(u); 438 438 return out; 439 439 } 440 440