0

By default TS RC1 output JS files in UTF-8 but we need him to output JS in ANSI. Is there a compiler argument to do this ?

6
  • Why would you need to do that? If you don't have localized strings in the source files, it would be ANSI characters. Commented Mar 12, 2014 at 10:44
  • Well, this application use only one langage (french with accents) for now. Indeed we could localize the resources in a linked js but it would have been nice to have all the code outputed in a single .js file to avoid http request for each script. But if we have no choice that's what we will end up doing. Commented Mar 12, 2014 at 14:23
  • 1
    But, why is UTF-8 output a problem? That should be the right file format I'd suspect, even with accented French. Commented Mar 12, 2014 at 15:22
  • UTF-8 shouldn't be a problem. I'm saving our french translations in a UTF-8 file and it's been working fine. Commented Mar 12, 2014 at 17:52
  • If I had started this project, I would have chose UTF-8. Commented Mar 14, 2014 at 15:18

2 Answers 2

2

There is no such argument in the tsc compiler (version 0.9.5).

You would have to use other tools to convert UTF-8 to ANSI in generated JS files.

Sign up to request clarification or add additional context in comments.

Comments

0

Please note that VisualStudio has Pre-build events. I'm not sure that it will help but you can write some .bat file to transform UTF-8 chars into codes before compiling.

2 Comments

If you use Intellij IDEA or WebStorm, you can use File Watcher plugin for this task.
In our case that would be Post-build events we would use but it's actually a great idea. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.