Skip to main content

I get twice a day an utf-8 file

I try to convert it with: 

move function display-of (function national-of (input), 1252) to output

But the output looks like the intput.

Does somebody know a solution.

 

 

I get twice a day an utf-8 file

I try to convert it with: 

move function display-of (function national-of (input), 1252) to output

But the output looks like the intput.

Does somebody know a solution.

 

 

I haven't had to do this in COBOL myself, but looking at the product docs, and assuming "input" is defined as pic x(...), then I think this would only work if RUNTIME-ENCODING is set to "UTF8".

If RUNTIME-ENCODING isn't set, then it inherits whatever is set for SOURCE-ENCODING; and if SOURCE-ENCODING isn't set, it defaults to "ANSI", I believe.

So I think you'll need to compile your program with RUNTIME-ENCODING"UTF8". That will tell the NATIONAL-OF function that the input is UTF-8, which it can then convert to UTF-16 (the internal encoding used for pic n), which can then be converted to the Windows 1252 code page.


I haven't had to do this in COBOL myself, but looking at the product docs, and assuming "input" is defined as pic x(...), then I think this would only work if RUNTIME-ENCODING is set to "UTF8".

If RUNTIME-ENCODING isn't set, then it inherits whatever is set for SOURCE-ENCODING; and if SOURCE-ENCODING isn't set, it defaults to "ANSI", I believe.

So I think you'll need to compile your program with RUNTIME-ENCODING"UTF8". That will tell the NATIONAL-OF function that the input is UTF-8, which it can then convert to UTF-16 (the internal encoding used for pic n), which can then be converted to the Windows 1252 code page.

when I set this I get

COBCH0053S Directive RUNTIME-ENCODING"UTF8" invalid or not allowed here

 


when I set this I get

COBCH0053S Directive RUNTIME-ENCODING"UTF8" invalid or not allowed here

 

OK, it's time to provide some actual useful information for us.

  • What product, version, and platform are you using?
  • Where did you set the directive? Did you consult the documentation for your product regarding the directive before setting it?

That sort of information should always be included when asking a question. We're not psychic. We only know what you tell us.


OK, it's time to provide some actual useful information for us.

  • What product, version, and platform are you using?
  • Where did you set the directive? Did you consult the documentation for your product regarding the directive before setting it?

That sort of information should always be included when asking a question. We're not psychic. We only know what you tell us.

Hi Michael_Wojcik,

 

I use the latest Version of Net Express V 5.117.0014.

I have also reported this to the support line #3200140

Kind Regards,

Georg Jarzak


Hi Michael_Wojcik,

 

I use the latest Version of Net Express V 5.117.0014.

I have also reported this to the support line #3200140

Kind Regards,

Georg Jarzak

You're using a 10-year-old product. It's possible you'll have to upgrade to something a little more recent.

You didn't answer my other questions.


You're using a 10-year-old product. It's possible you'll have to upgrade to something a little more recent.

You didn't answer my other questions.

Hi Michael_Wojcik,

the latest Update of NE 5.1 was from Dez.2018.

Support line is working on that issue. Thank You.

 


Hi Michael_Wojcik,

the latest Update of NE 5.1 was from Dez.2018.

Support line is working on that issue. Thank You.

 

Those are fixes, not new features. You're still using a ten-year-old product.