ASCII Extended 160 to ASCII 32?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf ASCII Extended 160 to ASCII 32?

  • Creator
    Topic
  • #50933
    Mark Perschbacher
    Participant

    I am working with a Centricity EMR vendor to get our narrative MDM messages to import into their system, and on some of the reports, their programmer is telling me that part of the results are coming across in ASCII Extended 160 characters, and their system can’t deal with it.  Their suggestion is to convert them to ASCII 32.  I have never run into this issue before.  Is this a valid request, and does anyone know how I would convert this?  We are running Win2003, Cloverleaf ver. 5.6 rev2.

Viewing 7 reply threads
  • Author
    Replies
    • #68063
      Robert Milfajt
      Participant

      I’d use regsub and null out the character, unless you have some need to display it.

      Code:

      regsub -all — {[x80-xff]} $oldvalue {} newvalue

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #68064
      Mark Perschbacher
      Participant

      Thanks for your unput Robert.  The vendor is claiming that what is erroring are some “nonbreaking spaces.”  So I guess I’ll try and trim them out.

    • #68065
      Jim Kosloskey
      Participant

      Mark,

      A NBSP (non-breaking space) character is used to stop line wrap within words or phrases.

      The value used as the NBSP is dependent on the character set used.

      I am assuming extended ASCII in your case but it is best to make sure.

      If it is extended ASCII then typically the xff is the character used.

      You may have other characters from the extended set that need to be there so I would make sure it is the xff that is the offender. Whatever character it is (there should only be one) is the only one I would change.

      Then a string map {xff ” “} variable will convert the hard space to a soft space.

      Take care though – the originating document may intend to not have the word/phrase conatining the NBSP ever wrap and now it will wrap – perhaps distorting the meaning of the document.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #68066
      Mark Perschbacher
      Participant

      As always, thanks a million for your expertise.  The offending characters are   and I have tried mapping that string to ” “, but the vendor is still erroring.  Is there another way I should represent this string to get tcl to map or reqsub it?

    • #68067
      Jim Kosloskey
      Participant

      Mark,

      Is the document provided HTML or SGML or Wikitext?

      Try looking at the message in Hex (one way is to save the message to a file from SMAT and the hcihd the file or use a Hex Editor) and verify the actual hex value. For HTML and SGML sometimes that value is actually hex a0. If so then the string mapping of xa0 to ” ” should work.

      But you need to verify what is actually in the inbound message in hex.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #68068
      Mark Perschbacher
      Participant

      when I run a sample file through Testing Tool, is showing up, which I am assuming is the character in question.  

      Here is the code I have inserted into the copy function

      set data $xlateInVals

      set change “”

      regsub -all — {xa0} $data {} change

      set xlateOutVals $change

      I have tried a buch of different combinations for the but can’t seem to get tcl to remove it.

    • #68069
      Jim Kosloskey
      Participant

      Mark,

      To be actually sure of what that hex value is use hcihd to get a hex dump of the message.

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #68070
      Mark Perschbacher
      Participant

      I had the syntax of the characters wrong, it is working fine.  Thanks Robert and Jim for your help.

Viewing 7 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,295
Replies
34,439
Topic Tags
287
Empty Topic Tags
10