Skip to main content

I have a problem with a diacritical mark, for example   ' ë '  ' ö '.

I have to make a file with fix length records with diacritical marks. I can make a 2 bytes diacritical mark and than it is possible to make a fixed length record. Now the user wants to have a character based file in fixed length. 

Is it possible to make that kind of  file in UTF-8.


#netexpress
#COBOLserver

I have a problem with a diacritical mark, for example   ' ë '  ' ö '.

I have to make a file with fix length records with diacritical marks. I can make a 2 bytes diacritical mark and than it is possible to make a fixed length record. Now the user wants to have a character based file in fixed length. 

Is it possible to make that kind of  file in UTF-8.


#netexpress
#COBOLserver

I would say UTF-8 by definition gives allwas strings of different length, because some characters use one byte and the diacritical use two or more bytes. If you cut the padding spaces you can obtain a fixed record file. Exception is the very special format  XML


I have a problem with a diacritical mark, for example   ' ë '  ' ö '.

I have to make a file with fix length records with diacritical marks. I can make a 2 bytes diacritical mark and than it is possible to make a fixed length record. Now the user wants to have a character based file in fixed length. 

Is it possible to make that kind of  file in UTF-8.


#netexpress
#COBOLserver

I'm not sure I entirely understand your question, but UTF-8 is a variable-length encoding. Non-ASCII characters can take 2 to 4 bytes (possibly more for invalid UTF-8 and variants). The only way to use a fixed-length field for UTF-8 is to make it large enough to accommodate the longest possible UTF-8 sequence you want to support.