Kbase 19153: converting double byte data to unicode ( UTF-8)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  24/09/1999 |
|
converting double byte data to unicode ( UTF-8)
WHY YOU NEED TO KNOW THIS:
There're couple of ways to do the double-byte to UTF-8 conversion in
V9:
Example: Language Japanese
Data file is in ode page shift-jis, want to convert into UTF-8
(unicode).
A. If the data file is just a normal text shift-jis file, you can:
- Start progress client using cpinternal=UTF-8 cpstream=UTF-8
- Write a simple *.p using INPUT FROM/OUTPUT TO with the CONVERT
option, then using the IMPORT/EXPORT(or PUT) to read and write the
files.
For example:
********************************************************************
DEFINE VARIABLE fline as CHARACTER.
OUTPUT TO utf8.dat APPEND.
INPUT FROM shift-jis.dat CONVERT TARGET "UTF-8" SOURCE "SHIFT-JIS".
REPEAT:
IMPORT UNFORMATTED fline.
PUT fline.
END.
OUTPUT CLOSE.
********************************************************************
- The the utf8.dat is an utf8 data file.
B. If the data file is a Progress database dump or input data file for
a database, you can:
- Create a utf-8 empty database by copying from DLC/prolang/utf/empty
- Start progress using cpinternal=shift-jis cpstream=shift-jis
- Connect to the utf8 database.
- Load the database schema and the data into the utf8 database from
the Database Admin. Progress will do the automatic conversion for you.
- Then start another progress client with cpinternal=UTF-8 cpstream=UT
F-8 and connect to the utf8 database.
- Dump the data from the utf8 database
C. Find some tools from the WEB that do the conversion between
double-byte and UTF-8.
KDA 24/09/1999