Welcome Guest! Log in
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.


Some UTF file encodings have a special "BOM" sequence of characters (Byte Order Mark).

Example when viewing an UTF-8 with BOM file within an ISO-8859-1 editor:

John;Doe
Jane;Jackson

 

When reading such files, these first characters may be considered as part of the data.

In order to ignore them, a simple trick in Stambia is to add a transformation script to the File metadata, such as:

i=0;
j=0;
do
{
    i=__in__.read();
    j=j+1;
    /* return data only after third character */
    if(j>3)
    {
         if (i>-1)
         {
             ch=String.fromCharCode(i);
             i=ch.charCodeAt();
             __out__.write(i);
         }
    }    
}while(i>-1);

 

 

You have no rights to post comments

Articles

Suggest a new Article!