几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】getlength90 and getlengtha90 (http://www.dimcax.com/hust/showthread.php?t=16395)

yang686526 2009-05-05 11:24 AM

【转帖】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


所有的时间均为北京时间。 现在的时间是 07:54 PM.