How to convert UTF-8 to ASCII using CONVERT TARGET

Hi All,
I have a db where data is stored as UTF-8. I am extracting some data from it.
Actually I am using a
Code:
OUTPUT TO VALUE ("xxxx") NO-CONVERT
but it produces me a UTF-8 with all special and national character. I would like to have my file in ASCII format without all special and especially without national characters. Therefore I was thinking to change my code to the following:
Code:
OUTPUT TO VALUE ("xxxx") CONVERT TARGET "yyy"
The only issue is that I don't know what I supposed to enter in place of "yyy".
 

KrisM

Member
"YYY" is the name of another codepage. Special characters have no representation in standard ascii.
Some special characters (like é or è or ë) can be converted to standard ascii (e), but certainly not all characters.
I do not know a routine that will do this conversion. You may have to write it yourself.
 

RealHeavyDude

Well-Known Member
Why do you need the file to be in ASCII format? You do know that you will lose/corrupt data?

Haven't tried it myself - but it might even be the case that your Progress session gets into trouble when it encounters characters which can't be converted.

Heavy Regards, RealHeavyDude.
 

Stefan

Well-Known Member
The only issue is that I don't know what I supposed to enter in place of "yyy".

A number of code page conversions are 'compiled' into $DLC/convmap.cp - the 'sources' are in $DLC/prolang/convmap. You can create your own code page mapping. The standard convmap.cp does contain a few 7-bit code pages (german-7-bit and swedish-7-bit) - these may meet your requirements.
 
Why do you need the file to be in ASCII format? You do know that you will lose/corrupt data?

Haven't tried it myself - but it might even be the case that your Progress session gets into trouble when it encounters characters which can't be converted.

Heavy Regards, RealHeavyDude.
I need to have output files in ASCII because I am sending it outside for let say 'analysis' and they can import only ASCII. I have only few national character that should be converted to their representatives in english like 'ś' to 's', 'ł' to 'l', 'ż' to 'z' etc. So such lose of data is fully accepted.
 
A number of code page conversions are 'compiled' into $DLC/convmap.cp - the 'sources' are in $DLC/prolang/convmap. You can create your own code page mapping. The standard convmap.cp does contain a few 7-bit code pages (german-7-bit and swedish-7-bit) - these may meet your requirements.
I was trying CONVERT TARGET “7-bit” but progress complains that code page conversion table from 'UTF-8' to '7-bit' can't be found in convmap.cp.
 

Stefan

Well-Known Member
I was trying CONVERT TARGET “7-bit” but progress complains that code page conversion table from 'UTF-8' to '7-bit' can't be found in convmap.cp.
So either use the a 7-bit code page that is available or create your own.
 
So either use the a 7-bit code page that is available or create your own.
The one which is available converts my national character to the question mark '?' which is not what I am expecting.
How can I create my own conversion?
Any good solution if I am interested only in conversion of some of the characters from UTF-8 to 7-bit ASCII?
How to apply that conversion later to the OUTPUT TO ... CONVERT statement?
 

Stefan

Well-Known Member
Top