If on Utf, i think you can try using "kcompress" instead of compress function and "ktranslate" instead of translate.
that should work.
@NN wrote:
If on Utf, i think you can try using "kcompress" instead of compress function and "ktranslate" instead of translate.
that should work.
You are right, I replaced the translate & compress to k-functions but at the same time
I had to enlarge the length of the string and finally got the correct results.
@FreelanceReinh I'm curious to know if you see the same symbols I see.
The next picture is the screenshot of my last post - what graphic is shown for 'EF'x and 'FF'x -
those tow characters which hold 2 bytes in your environment hold 4 bytes in UTF-8 environment:
@Shmuel wrote:
@FreelanceReinh I'm curious to know if you see the same symbols I see.
@Shmuel: I see the same symbols, but with my Wlatin1 session encoding the PUTLOG statement, of course, writes x=FEFF.
My first idea for these temporary replacement characters were non-printable characters like '02'x (especially to avoid ASCII codes >127), but these are less convenient to use in PRXCHANGE and also caused other difficulties. That's why I resorted to 'FE'x and 'FF'x (but there may be better choices, also depending on the language of the text and expected characters in variable STRING).
May I summit this chain from my point of view:
1) While test was moved between different encoding environments (in this case from Latin1 to UTF-8)
the hexadecimal representation of characters was changed in order to keep their visual appearance.
2) The target of this post was an interesting challenge of programming for me and at the same time
a good experience to understand Perl expression (Regex) used with prxchange function and the
usage of k functions (ktranslate, kcompress) - both new for me.
So thanks a lot to @FreelanceReinh and to @NN for your responses.
I appreciate it very much. Have a nice day.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.