1

I've a string with some Spanish characters and when I use the U2's OCONV() function with the code 'MCT', it changes the Spanish Character to something else. Does anyone know?

STRING: T r L=16 `CITáN, MOR 32000'

TEST.MCT:   5: STR2 = OCONV(STR,'MCT')
:: S
TEST.MCT:   6: CRT STR2
:: S
Cit?9: Mor 32000
herohuyongtao
  • 49,413
  • 29
  • 133
  • 174
  • 1
    Which version of U2 are you using? UniData Or UniVerse? Based on the example you provided, MCT is doing bit math to create the lower case character. With a char above ASCII 128, it would translate incorrectly. Make sure your database is setup to accept Unicode, but this may be a bug in the MCT with chars above ASCI 128. – International Spectrum Mar 19 '14 at 19:07

2 Answers2

1

Note that I created the following program, and I do not see the issue.

CT BP SO

 SO
 0001 STR = "CIT":CHAR(225):"N, MOR 3200"
 0002 STR2 = OCONV(STR, "MCT")
 0003 PRINT STR
 0004 PRINT STR2
 0005 PRINT SEQ(STR2[4,1])

When I compile and run it, I get the following:

 CITáN, MOR 3200
 Citán, Mor 3200
 225
 >

Note that I tested UniVerse11.2.2, on Windows. Can you try the sample code I provided from the HS.SALES account, and let me know what it does?

If it still has an issue, please let us know the full UniVerse version, and the OS you are running this on.

added info: note tested on UniVerse 11.1.1 on AIX 6.1 and it worked for me. If you are still having issues, I suggest you contact you UniVerse Maintenance provider.

Mike
  • 194
  • 11
  • We are using Universe V11.1 on a Unix AIX ver 6.1 Thanks. I stepped through the debugger and go the followings: – user1387287 Mar 27 '14 at 16:51
  • We are using Universe V11.1 on a Unix AIX ver 6.1 Thanks. I stepped through the debugger and go the followings: RAID BP TEST.CH TEST.CH: 1: STR = "CIT":CHAR(225):"N, MOR 3200" :: S TEST.CH: 2: STR2 = OCONV(STR, "MCT") :: STR/ STRING: T r L=16 `CITáN, MOR 3200' :: S TEST.CH: 3: CRT STR :: STR2/ STRING: T r L=16 `CitÃ6n, Mor 3200' :: S CITáN, MOR 3200 TEST.CH: 4: CRT STR2 :: S Cit?n, Mor 3200 – user1387287 Mar 27 '14 at 16:58
  • TEST.CH: 2: STR2 = OCONV(STR, "MCT") :: STR/ STRING: T r L=16 `CITáN, MOR 3200' :: S TEST.CH: 3: CRT STR :: STR2/ STRING: T r L=16 `CitÃ3n, Mor 3200' :: S CITáN, MOR 3200 TEST.CH: 4: CRT STR2 :: S Cit?n, Mor 3200 – user1387287 Mar 27 '14 at 17:05
  • I tried it on the NLS enable box and got the following:0001: CIT?N, MOR 3200, Cit?n, Mor 3200 Bottom at line 1. ----: ^ Up-arrow display mode = enabled WARNING: Line has invalid internal characters, and may display incorrectly. 0001: CIT^225N, MOR 3200, Cit^!!!!n, Mor 3200 Bottom at line 1. ----: – user1387287 Mar 27 '14 at 17:15
  • It is hard to read your results. Can you run it outside of the debugger, and display the results (please set as a code block for easier reading on the post to stackoverflow). Also, what is LANG set to? – Mike Apr 11 '14 at 13:13
0

It is hard to read your output since it combines lines.

My run through RAID shows the correct information.

RAID BP SO
 SO:   1:  STR = "CIT":CHAR(225):"N, MOR 3200"
:: S
 SO:   2: STR2 = OCONV(STR, "MCT")
:: S
 SO:   3: PRINT STR
:: S
CITáN, MOR 3200
SO:   4: PRINT STR2
:: S
Citán, Mor 3200
 SO:   5: PRINT SEQ(STR2[4,1])
:: S
225

Yet, I have LANG=en_US in my UNIX environment variables.

So, there may be an issue with your environment based on what LANG is set, I suggest you contact you U2 Maintenance provider.

Mike
  • 194
  • 11