A Class worth exploring for handling special characters in MDM

While development was going at full pace ,a small hurdle in form of special characters turned out to be a real speed breaker.The situtaion was that in MDM repository some field say Name contained  special chracters(Õ , û  ,Û)  in  other language like Hungarian,German ,French etc.Problem was I  logged into the Repository with english language with MDM JAVA API and  API was retrieving undesired value(O??,u??,U??) from the data manager .Although the Name string seems absolutely fine in the Data Manager.In short -value in MDM Data Manager for field name was Õ û  Û and output from API was O??u??U??

To my rescue came this class which is worth exploring when you have a situation like above

Class SetUnicodeNormalizationCommand

After you establish your connection to the server through API and Authenticate User Session ,you need to work with this class.

Connection to server would return an object of type ConnectionPool (call it connection)and UserSession authentication would return a string (call it session).Now write this piece of code

SetUnicodeNormalizationCommand cmd = new SetUnicodeNormalizationCommand(connection);

cmd.setSession(session);

cmd.setNormalizationType(SetUnicodeNormalizationCommand.NORMALIZATION_COMPOSED);

cmd.execute();

This class will keep the special characters retrieval intact.

SAP Developer Network Latest Updates