Changing package content in batch

I would like to know if it's safe to do batch operations in a list of package files, applying a function like this:

SetAttributes[packStringReplace,HoldRest]
packStringReplace[packPath_String,{replaceRule__}]:=Module[{pack},
pack=Import[packPath,"Text"];
pack=StringReplace[pack,{replaceRule}];
Export[packPath,pack,"Text"]
]

packs=FileNames["*.m","/packageDirectory",∞];
packStringReplace[#,{"text1"->"text2","text3"->"text4"}]&/@packs


Can Import and Export change something inside pack in some unexpected way? It's safe? Or should I use ImportString or another Import equivalent? If yes, why?

Update

As pointed by @AlbertRetey in the comments, it's safer do use:

Export[packname,pack,"Text",CharacterEncoding->"ASCII"]

Export[packPath,pack,"Text"]
@AlbertRetey nice advice. So maybe it would be better to do: Export[packname,pack,"Text",CharacterEncoding->"ASCII"]? –  Murta Feb 10 '14 at 12:32
@AlbertRetey, I have made a test, and it's very important, there is an simple example: Export["test1.txt","b \[Rule] a","Text"]. Without use CharacterEncoding->"ASCII", I get problem with [Rule] graphic object. Tks –  Murta Feb 10 '14 at 12:36
I'm actually surprised that my comment seems more relevant than I thought. The problem is that importing and reexporting won't create the same thing as the Mathematica-specific "ascii"-encoding of special characters is only correctly done when using the CharacterEncoding option for Export. Here is an example to play with: ExportString[ImportString["b [Rule] a", "Text"], "Text"]. Of course this is mainly relevant if the package files are generated from a notebook with the auto save as package functionality, otherwise you probably won't expect such characters in a package file... –  Albert Retey Feb 10 '14 at 15:04