tetsuya24 / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

string content in french language changes in print instruction when i save #753

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. new file lambdalambala.py
2. add a line in main() => print("l'année est 2013")
3. save the file
4. launch lambdalambala.py, result is as expected
4. close and open the file again, the last instruction became: 
print("l'année est 2013")

What is the expected output? What do you see instead?
I believed that the code content should stay the same when I closed and opened 
again the file. Actually, as long as I keep my file.py open the situation is 
good, but when I close and open the file again, all strings in print are not 
encoding in the french style that I'd at the beginning.

What version of the product are you using? On what operating system?
I use pyscripter version 2.5.3.0 X64 on Window 7.

Please provide any additional information below.
I think it's all, thanks for helping me!

Original issue reported on code.google.com by xavier.s...@gmail.com on 11 Nov 2013 at 8:51

GoogleCodeExporter commented 9 years ago
You need to save the file as UTF-8.

From the Help file topic Encoded Python Source Files:

UTF-8 encoded source files

You can select this encoding from the File Formats submenu of the Edit menu.  
From that menu you can select whether UTF-8 encoded source files include the 
BOM UTF-8 signature which is detected by the Python interpreter.  This 
signature is also detected by PyScripter when a file is loaded and other 
Windows editors. Although it is not necessary you are advised to include an 
encoding comment such as

# -*- coding: utf-8 -*-

as the first or second line of the python script.  The advantage of using UTF-8 
encoded files is that they can run without modification in other computers with 
different default encoding. When using UTF-8 encoding you should specify all 
strings that are not plain ascii as python unicode stings by adding the prefix 
'u'.

Original comment by pyscripter on 24 Mar 2015 at 6:40