# How do we properly handle apostrophes in IfcLabel?

**URL:** <https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231>\
**Category:** IFC (General Development)\
**Tags:** ifc, character-handling, encoding\
**Created:** [May 12, 2022, 4:14pm UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231 "2022-05-12T16:14:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/ian/32/21_2.png) [@ian](https://forums.buildingsmart.org/u/ian)\
**Post date:** [May 12, 2022, 4:14pm UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231/1 "2022-05-12T16:14:40Z")

</div>

We have an IfcLabel which contains an apostrophe and it’s breaking at least two viewers that we know of. How do we escape “special” characters in IFC with a guarantee that viewers will handle un-escaping?

---

<div class="post-metadata">

**Author:** ![jwouellette](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/jwouellette/32/2140_2.png) [@jwouellette](https://forums.buildingsmart.org/u/jwouellette)\
**Post date:** [May 13, 2022, 3:04pm UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231/2 "2022-05-13T15:04:54Z")

</div>

Hey @ian,  
I know we have only a couple resources that address this:

- An implementation Agreement for IFC2x3: [CV-2x3-132 (buildingsmart.org)](https://standards.buildingsmart.org/documents/Implementation/IFC_Implementation_Agreements/CV-2x3-132.html)
- An Implementation Guidance page: [IFC String Encoding - buildingSMART Technical](https://technical.buildingsmart.org/resources/ifcimplementationguidance/string-encoding/)

Maybe @Evandro, @GeorgDangl, @linhard, or @mweise can help? I think this issue might be part of certification.

---

<div class="post-metadata">

**Author:** ![aothms](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@aothms](https://forums.buildingsmart.org/u/aothms)\
**Post date:** [May 15, 2022, 11:16am UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231/3 "2022-05-15T11:16:11Z")

</div>

For clarity:

From 10303 21 we can read:

> **6.4.3.1 String structure**
> 
> … Within a string, a single _apostrophe_ shall be encoded as two consecutive _apostrophes_

I must say that I’ve personally never have encountered issues with this in any implementation I’m aware of.

---

<div class="post-metadata">

**Author:** ![ian](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/ian/32/21_2.png) [@ian](https://forums.buildingsmart.org/u/ian)\
**Post date:** [May 16, 2022, 3:55am UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231/4 "2022-05-16T03:55:01Z")

</div>

Thanks @aothms.

As far as I can tell, you mean ISO 10303 part 21, which is a paywalled iso standard that a developer can’t access. Yes, they could spend the money and buy the standard, and look up the section on string encoding, but they’re probably not going to do it.

---

<div class="post-metadata">

**Author:** ![aothms](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@aothms](https://forums.buildingsmart.org/u/aothms)\
**Post date:** [May 16, 2022, 8:35am UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231/5 "2022-05-16T08:35:42Z")

</div>

I agree, I’ve created an issue to improve [IfcLabel/IfcText etc. · Issue #476 · buildingSMART/IFC4.3.x-development · GitHub](https://github.com/buildingSMART/IFC4.3.x-development/issues/476)

---

<div class="post-metadata">

**Author:** ![Moult](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.buildingsmart.org/moult/32/196_2.png) [@Moult](https://forums.buildingsmart.org/u/Moult)\
**Post date:** [May 16, 2022, 11:36am UTC](https://forums.buildingsmart.org/t/how-do-we-properly-handle-apostrophes-in-ifclabel/4231/6 "2022-05-16T11:36:39Z")

</div>

For reference, this is a great link 🙂 [https://www.steptools.com/stds/step/IS\_final\_p21e3.html#clause-6-4-3](https://www.steptools.com/stds/step/IS_final_p21e3.html#clause-6-4-3)
