FormBuilder: Saving flat-file in ANSI?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
superstoffe
Forum Members
Forum Members
Posts: 50
Joined: Fri Jan 16, 2009 1:07 pm

FormBuilder: Saving flat-file in ANSI?

Post by superstoffe »

Is it possible to control how the flat-file function saves the file, and what encoding it should use? Or is that server based of some sort?

I've got a request to get files in ANSI, to be able to import them into a business system. Would be awesome to get it to work.
Peciura

Re: FormBuilder: Saving flat-file in ANSI?

Post by Peciura »

I've got a request to get files in ANSI
Do you mean "ASCII" ?
ASCII is subset of UTF-8 (variable byte length encoding). If you don't have any special characters (e.g. English only) your document is encoded in both ASCII and UTF-8. To avoid unexpected behavior you might want to use function "htmlspecialchars".
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm
Location: Marlow, UK

Re: FormBuilder: Saving flat-file in ANSI?

Post by scooper »

They probably do mean ANSI - it's an old Windows character set http://en.wikipedia.org/wiki/Windows-1252  - I seem to remember it's the default if you save text files from Notepad.

Anyway - it's probably going to be a bit of trial and error but should be doable.

You could try and set the character set in Form Builder (not great if you want to upgrade), or you could write a tag that converted the file to the right character set.

Take a look at iconv http://www.php.net/manual/en/function.iconv.php and iconv_set_encoding http://www.php.net/manual/en/function.iconv-set-encoding.php as a start.

Or of course tell your business system people to get into the 21st Century and move to UTF-8.

s.
User avatar
mr_to
New Member
New Member
Posts: 2
Joined: Mon Jan 04, 2010 11:11 am

EXCEL dont read UTF8 files only ANSI files

Post by mr_to »

hi everybody  
i have the same problem
all my servers are in UFT8, everythings ok
BUT with formbuilder
when i write the posted data on a flat file csv for excel
this one don't know  what is UTF8
he read only ANSI encoding

I look for a solution to write data ANSI encodedin the flat file

if anyone have a hack of code or a simple solution
regards
MR TO

ok here is my solution

creat a "utf_8_decode" user tag

if( isset( $params['datatoconvert'] ) )
{
echo (utf8_decode ($params['datatoconvert']));
}

in the Template for one line of output file (in the field write to flat file)

use the Variables For Template aliases as params

{utf_8_decode datatoconvert=$fld_30 };{utf_8_decode datatoconvert=$fld_31 };{utf_8_decode datatoconvert=$fld_32 }

with all the fields you need

hope this can help someone again

Regards
TO
Last edited by Anonymous on Sun Jan 31, 2010 1:09 pm, edited 1 time in total.
yurayurayura
New Member
New Member
Posts: 2
Joined: Fri Jun 08, 2012 5:43 am

Re: FormBuilder: Saving flat-file in ANSI?

Post by yurayurayura »

Post Reply

Return to “Modules/Add-Ons”