<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AutoCAD Character Codes In Text String in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-character-codes-in-text-string/m-p/4646973#M46835</link>
    <description>&lt;P&gt;I'm experiencing some inconsistent behavior with text (normal text, mtext, text in a table) and character codes.&amp;nbsp; I'll provide some examples of what I'm seeing... and hopefully someone can help me to understand what's going on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use a customized shx font that has stacked fractions in sixteenth increments from character 181 to 195 (1/16 to 15/16).&amp;nbsp; So, when entering 1/16, a user would typically type %%181 as the text value, and AutoCAD displays the correct stacked fraction.&amp;nbsp; This works in normal text, but not in mtext or in a table.&amp;nbsp; With mtext or a table, I can copy and paste character 181 (for instance) - which looks like [ µ ] - and the correct stacked fraction will show up.&amp;nbsp; Surely there is a way to do this without copy and paste, but I haven't gotten that far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, so - you're probably wondering why I am writing this in the .NET forum.&amp;nbsp; Well, here is where some code comes in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With normal text, I can set DBText.TextString = "%%181".&amp;nbsp; This will display the correct stacked fraction (1/16).&amp;nbsp; If I then retrieve the text again - string myText = DBText.TextString), the value is as expected - "%%181".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a user types "%%181" in a piece of text, and then I read the piece of text, the value is character 181.&amp;nbsp; This was not the case in AutoCAD 2006, where TextString would still reflect "%%181" - behavior that (to me) made sense, because it was consistent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of this becomes a problem when programmatically parsing text.&amp;nbsp; Sometimes it has %%[character code], and sometimes it has the character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please shed some light on this?&lt;/P&gt;</description>
    <pubDate>Sat, 23 Nov 2013 14:20:41 GMT</pubDate>
    <dc:creator>absStructural</dc:creator>
    <dc:date>2013-11-23T14:20:41Z</dc:date>
    <item>
      <title>AutoCAD Character Codes In Text String</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-character-codes-in-text-string/m-p/4646973#M46835</link>
      <description>&lt;P&gt;I'm experiencing some inconsistent behavior with text (normal text, mtext, text in a table) and character codes.&amp;nbsp; I'll provide some examples of what I'm seeing... and hopefully someone can help me to understand what's going on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use a customized shx font that has stacked fractions in sixteenth increments from character 181 to 195 (1/16 to 15/16).&amp;nbsp; So, when entering 1/16, a user would typically type %%181 as the text value, and AutoCAD displays the correct stacked fraction.&amp;nbsp; This works in normal text, but not in mtext or in a table.&amp;nbsp; With mtext or a table, I can copy and paste character 181 (for instance) - which looks like [ µ ] - and the correct stacked fraction will show up.&amp;nbsp; Surely there is a way to do this without copy and paste, but I haven't gotten that far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, so - you're probably wondering why I am writing this in the .NET forum.&amp;nbsp; Well, here is where some code comes in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With normal text, I can set DBText.TextString = "%%181".&amp;nbsp; This will display the correct stacked fraction (1/16).&amp;nbsp; If I then retrieve the text again - string myText = DBText.TextString), the value is as expected - "%%181".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a user types "%%181" in a piece of text, and then I read the piece of text, the value is character 181.&amp;nbsp; This was not the case in AutoCAD 2006, where TextString would still reflect "%%181" - behavior that (to me) made sense, because it was consistent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of this becomes a problem when programmatically parsing text.&amp;nbsp; Sometimes it has %%[character code], and sometimes it has the character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please shed some light on this?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 14:20:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-character-codes-in-text-string/m-p/4646973#M46835</guid>
      <dc:creator>absStructural</dc:creator>
      <dc:date>2013-11-23T14:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD Character Codes In Text String</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-character-codes-in-text-string/m-p/4647047#M46836</link>
      <description>&lt;P&gt;I should also note - that a significant problem is that we are currently still using AutoCAD 2006.&amp;nbsp; The ObjectArx code written for it doesn't use unicode.&amp;nbsp; When a drawing is made with AutoCAD 2012, saved to an older format, and opened in AutoCAD 2006 - the ObjectArx code is reading single byte chars, but AutoCAD 2012 has written multibyte chars.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somehow AutoCAD 2006 is displaying them properly.&amp;nbsp; The ObjectArx code reading single byte chars isn't handling it so well (obviously).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2013 16:37:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-character-codes-in-text-string/m-p/4647047#M46836</guid>
      <dc:creator>absStructural</dc:creator>
      <dc:date>2013-11-23T16:37:11Z</dc:date>
    </item>
  </channel>
</rss>

