outaTiME / grunt-replace

Replace text patterns with applause.
MIT License
411 stars 47 forks source link

ANSI File #81

Closed emalherbi-zz closed 9 years ago

emalherbi-zz commented 9 years ago

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.

outaTiME commented 9 years ago

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

thks !

outaTiME commented 9 years ago

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 !

emalherbi-zz commented 9 years ago

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.

outaTiME commented 9 years ago

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

outaTiME commented 9 years ago

you could try:

{
  patterns: [
    {
      match: 'foo',
      replacement: 'bar'  // replaces "@@foo" to "bar"
    }
  ], 
  encoding: 'iso-8859-1'
}
emalherbi-zz commented 9 years ago

Hey man,

It's work.

Tnks

outaTiME commented 9 years ago

:+1: