October 7, 20196 yr I have built CI tools in FileMaker for generating config files for services such as postgres, nginx, apache, and others. It all looks good, however the output is UTF-16 with some odd line breaks, Windows-like? $ exa -T sites-available sites-available ├── api.domain.tld ├── document.domain.tld ├── filemaker.domain.tld ├── graphql.domain.tld ├── rest.domain.tld ├── soap.domain.tld ├── webrtc.domain.tld ├── www.domain.tld └── www2.domain.tld Is there a way to set the settings for these export field contents as UTF-8 with regular unix line breaks? Even though this is written to a local folder on a workstation git handles the transfer to the server itself. Right now I have to do on a Mac or in unix/linux quite simply( published the one liner on gist: https://gist.github.com/TyrfingMjolnir/17e5f7de32ba6b36964622a2d0e1392b 😞 iconv -f UTF-16 -t UTF-8 sites-available/api.domain.tld | tr "\r" "\n" however for Windows not necessarily that easily before I do git push Edited October 7, 20196 yr by ggt667
October 7, 20196 yr 9 minutes ago, ggt667 said: Is there a way to set the settings for these export field contents as UTF-8 with regular unix line breaks? Starting from version 16, you can control the encoding and the line endings of the exported file using the method described here:
October 7, 20196 yr Author You mention some workaround inside FileMaker? Similar to this one: https://filemakerhacks.com/2017/05/09/export-field-contents-update-for-fm-16/ Poor Beverly, That's not a fix, it's an insult to people's intelligence. From what you write I assume there is no way to set the line breaks and encoding of the Export Field Contents? Edited October 7, 20196 yr by ggt667
October 7, 20196 yr https://fmhelp.filemaker.com/help/18/fmp/en/#page/FMP_Help%2Ftextencode.html As @comment indicates, we've had these functions since FM16. Not a workaround, pure native functions. If you were expecting to apply the encoding and line-endings as options on the export field contents dialog itself, then no. That's not how it works.
October 7, 20196 yr Author 25 minutes ago, Wim Decorte said: https://fmhelp.filemaker.com/help/18/fmp/en/#page/FMP_Help%2Ftextencode.html As @comment indicates, we've had these functions since FM16. Not a workaround, pure native functions. If you were expecting to apply the encoding and line-endings as options on the export field contents dialog itself, then no. That's not how it works. Thanks, then "AppleScript DoShellScript()" it is If I should ever run the solution on Windows, I may look into the way you describe. Edited October 7, 20196 yr by ggt667
October 7, 20196 yr I'm afraid you're speaking in riddles; why would you use applescript? What is described in the FM helps works without it. And works the same in FM as in Windows.
October 7, 20196 yr Author As that's the way it's already implemented, doing the reformatting in FileMaker does not really do it better; or worse. In which case would one ever benefit from using \r as line break and UCS-16 or UTF-16 as encoding? It makes regular text double the size. In my case I have just below 200 nginx vhost files, there is about 20 of them pr solution and development, testing and production for each. Edited October 7, 20196 yr by ggt667
October 8, 20196 yr You could use a plugin such as BaseElements to export to a text file. Then you can parse line by line and add whatever line ending you want.
October 9, 20196 yr Author I gave this( https://filemakerhacks.com/2017/05/09/export-field-contents-update-for-fm-16/ ) a shot. Set Field[ myTable::ExportFldContainer; TextEncode( GetLayoutObjectAttribute( "SomeMergeFieldObject", "content" ); "utf-8"; 3 ) ] The value of `myTable::ExportFldContainer` is "utf-8" Also the following yields the same proceeds Set Field[ myTable::LayoutObjectContent; GetLayoutObjectAttribute( "SomeMergeFieldObject", "content" ) ] Set Field[ myTable::Output; TextEncode( myTable::LayoutObjectContent; "utf-8"; 3 ) ] Edited October 9, 20196 yr by ggt667
October 9, 20196 yr 1 hour ago, ggt667 said: The value of `myTable::ExportFldContainer` is "utf-8" If you have done what you describe, and the field myTable::ExportFldContainer is indeed a container field, then it will contain a file named "utf-8.txt". This file will be UTF-8 encoded and contain the content of the merged text object, with LF line endings. -- As a side note, I am not sure why you would want to go to through the layout and export a merged field instead of remaining at the data level and export the field itself.
Create an account or sign in to comment