7

I am uploading some .js files to an s3 bucket through Travis, one of the files has the following regex:

/(^[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+)/

The Travis .yml file is super simple:

- provider: s3
  access_key_id: THEKEY
  secret_access_key:
    secure: THESECUREDKEY
  bucket: my-bucket
  local-dir: build
  skip_cleanup: true
  on:
    branch: master
  acl: public_read

Nothing strange there, but after doing the upload, I am getting the following result inside the .js containing that regex (instead of the regex that I supplied):

/(^[a-zA-Zà áâäãåąÄćęèéêëėįìíîïłńòóôöõøùúûüųūÿýżźñçÄšžÀÃÂÄÃÅĄĆČĖĘÈÉÊËÌÃÃŽÃÄ®ÅŃÒÓÔÖÕØÙÚÛÜŲŪŸÃŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+)$/

As you can see, I missed most of the characters.

Is there a way to set the encoding to Travis when doing an upload to an s3 bucket? Am I missing something else?

lante
  • 7,192
  • 4
  • 37
  • 57
  • 1
    Is your file properly encoded ? use one of the solution proposed [here](https://stackoverflow.com/questions/11018967/how-can-i-be-sure-of-the-file-encoding) to ensure that. Does the proper metadata have been set ? (You should find a Content-Type entry in the metadata section of your file properties in AWS console) – rolebi Jan 15 '16 at 11:24

1 Answers1

0

You are facing encoding problems. When this occurs your should check if anything between the start and the endpoint missing the encoding information for your file.

You have only Travis >> AWS, so its pretty easy. Try setting content-encoding to true

  • As @rolebi sad, also check file encondig if you are not sure about it. –  Jan 18 '16 at 00:21
  • setting `detect_encoding` to `true` didn't work for me – lante Jan 18 '16 at 15:07
  • can you provide a sample branch with this part of your code? I'll try to figure out whats happen here –  Jan 18 '16 at 17:06