查看单个帖子
旧 2009-05-05, 11:24 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】getlength90 and getlengtha90

getlength() and getlengtha()
getlength() and getlengtha()
hi,
i'm using version 2.03.01 of the libraries.
i'm reading an mtext entity whose contents are "\a1;\u+22050.500"
this is part of a dimension entity and i think the "\u+2205" part of the text string represent a diameter symbol in autocad.
when i use odstring's getlength() function on this string it returns 10, but getlengtha() returns 16. my version of the documentation tells me of the existence of getlengtha() but doesn't give any description of it.
this is not really a problem for me, but i am just curious as to the difference between these 2 functions, and should i always use getlengtha() when getting string lengths?
by default odstring contains unicode character buffer. all string modifications are performed on that buffer. but odstring may also contain mbcs string. it is either created in odstring construction (e.g. constructing odstring from char buffer produces such string), or by demand, in function 'getlengtha' and in 'operator char*'
getlength() returns unicode string length.
getlengtha() returns the length of the mbcs string.
vladimir
ah, right. so \u+.... signifies a unicode character.
thanks for the info.
geoff
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)