outaTiME/grunt-replace

ANSI File

emalherbi-zz opened this issue · 7 comments

Hi.

I have a file "install.iss" in ANSI codification, this file is generated automatic. So if a replace the file "install.iss" using "grunt-replace" the new file codification is UTF8, but some erros show in file, see example:

Configuração do SQL Server
Configura��o do SQL Server

Is possible to use only ANSI format in this case?

Tks.

Hi, pal ... something wired probably it comes from grunt ... i will check soon ...

thks !

Hi pal, now you can try to use your own encoding using the encoding flag:

https://github.com/outaTiME/grunt-replace#encoding

It uses uft-8 by default (http://gruntjs.com/api/grunt.file#grunt.file.defaultencoding), you could try something like:

{
  patterns: [
    {
      match: 'foo',
      replacement: 'bar'  // replaces "@@foo" to "bar"
    }
  ], 
  encoding: 'ascii'
}

I wait for your feedback ... thks !

Hey man,

Not work's. See :(

Input:
Configuração do SQL Server

Output:
Configuragco do SQL Server

But it is not necessary to change anything, I made changes in my original file and removed the accentuation.

oups bad news, you could try another encoding ...
we delegate encoding logic to grunt core ... it might be work

you could try:

{
  patterns: [
    {
      match: 'foo',
      replacement: 'bar'  // replaces "@@foo" to "bar"
    }
  ], 
  encoding: 'iso-8859-1'
}

Hey man,

It's work.

Tnks

👍