Nueva publicación

查找

Artículo
· 6 mayo, 2025 Lectura de 3 min

How to remove special characters (Unicode Characters) from text

It helps to remove special characters, such as non-utf-8 characters either control characters or unicode characters from text that is not printable or can't be parsed by downstream systems.

There is also $C(32) in this condition; sometimes NBSP appears in the text and it will not be recognized by TIE, but downstream it displays as "?".

In order to avoid the NBSP issue, the if condition is replaced with a space in order to prevent the error.

Unicode characters only Remove:

Class Test.Utility.FunctionSet Extends %RegisteredObject
{ 
ClassMethod ConvertTextToAscii(text As %String) As %String
{
 Set (str,char) = ""

 FOR i=1:1:$LENGTH(text)
 {
      Set char = $E(text, i)
      Set ascii = $ASCII(char)
      
      IF ascii'<33,ascii>126 {       
          ///ascii 32 included to avoid NBSP
      "Removing"_" ASCII code of "_ascii_" character is: "_char,!
      Set char = " "
      }
      Set str = str_char
    }
    Set str = $Replace(str," ","")
      
 QUIT str
}

}

Output:

W ##class(Test.Utility.FunctionSet).ConvertTextToAscii( "This”text is€example for × special € unicode — characters.•!!£;: with in the text? @downstream systems <removing (-)them> from {+adding some $%^'#utf-8'-_¦¬test@hotmail.com!"),!
Removing ASCII code of 8221 character is: ”
Removing ASCII code of 8364 character is: €
Removing ASCII code of 160 character is:  
Removing ASCII code of 215 character is: ×
Removing ASCII code of 8364 character is: €
Removing ASCII code of 8212 character is: —
Removing ASCII code of 8226 character is: •
Removing ASCII code of 163 character is: £
Removing ASCII code of 166 character is: ¦
Removing ASCII code of 172 character is: ¬
This text is example for special unicode characters. !! ;: with in the text? @downstream systems <removing (-)them> from {+adding some $%^'#utf-8'-_test@hotmail.com!

 

Including Control characters as well as Unicode characters to strip from Text:

ClassMethod ConvertTextToAscii(text As %String = "Testing unicode”charactersand€control characters×removing unicode—andcharacters.•and!£;:?$%^'#utf-8'-_¦¬test@hotmail.com!") As %String
{
Set (str,char) = "" FOR i=1:1:$LENGTH(text)
    {
      Set char = $E(text, i)
      Set ascii = $ASCII(char)
      //W "Ascii of char "_char_" is"_ascii,!
      IF ascii<33!(ascii>126) {       
          ///ascii 32 included to avoid NBSP
      "Removing"_" ASCII code of "_ascii_" character is: "_char,!
      Set char = " "
      }
      Set str = str_char
    }
    Set str = $Replace(str," ","")
      
 QUIT str
}


 

4 comentarios
Comentarios (4)3
Inicie sesión o regístrese para continuar
Artículo
· 6 mayo, 2025 Lectura de 13 min

Plateforme de données InterSystems IRIS : Аrchitecture

La plateforme de données InterSystems IRIS est à la base de toutes les applications InterSystems, ainsi que de milliers d'applications utilisées par nos clients et partenaires dans des domaines tels que la Santé, les Services financiers, la Chaîne logistique et d'autres écosystèmes. Il s'agit d'une plateforme convergente qui fournit une gestion des données transactionnelles et analytiques, une interopérabilité intégrée, une intégration des données, ainsi que des analyses intégrées et une IA. Elle prend en charge l'approche InterSystems Smart Data Fabric pour la gestion de données diverses et distribuées.

 

Comentarios (0)1
Inicie sesión o regístrese para continuar
Pregunta
· 5 mayo, 2025

InterSystems HL7 Interface Specialist certificate test

Hi group,

I am trying to take the InterSystems HL7 Interface Specialist certificate test. 

So is this an open book test? is there any Lab involved with vm?  I did the search but I am not able to find such information.

I am trying to find out more information before I actually take the test.

 

Thank you

7 comentarios
Comentarios (7)2
Inicie sesión o regístrese para continuar
Anuncio
· 5 mayo, 2025

[Video] Prompt the frontend UI for InterSystems IRIS with Lovable

Hi Community!

Check out the new video on how to build the frontend UI by prompting it in lovable or (potentially) any spec first REST API in InterSystems IRIS:

📺  Prompt the frontend UI for InterSystems IRIS with Lovable

🗣 Presenter: @Evgeny Shvarov, Senior Manager of Developer and Startup Programs, InterSystems

Share your thoughts or questions in the comments to this post. Enjoy!   

3 comentarios
Comentarios (3)2
Inicie sesión o regístrese para continuar
Resumen
· 5 mayo, 2025

Publicações Desenvolvedores InterSystems, Abril 28 - Maio 04, 2025, Resumo

Abril 28 - Maio 04, 2025Week at a GlanceInterSystems Developer Community