2012-08-31 14 views
9

क्या लिनक्स/x86_64 पर जीसीसी 4.7 में एक डिफ़ॉल्ट वर्ण एन्कोडिंग है जिसके द्वारा यह सी स्रोत फ़ाइलों में स्ट्रिंग अक्षर की सामग्री को मान्य और डीकोड करता है? क्या यह विन्यास योग्य है?जीसीसी 4.7 स्ट्रिंग लिटल के लिए स्रोत कैरेक्टर एन्कोडिंग और निष्पादन कैरेक्टर एन्कोडिंग?

आगे, आउटपुट के डेटा सेक्शन में स्ट्रिंग डेटा से स्ट्रिंग डेटा को लिंक करते समय क्या इसका डिफ़ॉल्ट निष्पादन वर्ण एन्कोडिंग होता है? क्या यह विन्यास योग्य है?

किसी भी कॉन्फ़िगरेशन में स्रोत स्रोत एन्कोडिंग होना संभव है जो निष्पादन वर्ण एन्कोडिंग से अलग है? (यह जीसीसी कभी भी एन्कोडिंग के बीच ट्रांसकोड करेगा?)

उत्तर

11

मुझे नहीं पता कि ये विकल्प वास्तव में कितनी अच्छी तरह से काम करते हैं (उन्हें एटीएम का उपयोग नहीं करते; मैं अभी भी स्ट्रिंग अक्षर को 'ASCII' के रूप में पसंद करना पसंद करता हूं, क्योंकि स्थानीय तार वैसे भी बाहरी फ़ाइलों तो यह ज्यादातर प्रारूप स्ट्रिंग या फ़ाइल नाम) जैसी चीजों है, लेकिन वे

-fexec-charset=charset 
Set the execution character set, used for string and character constants. The default 
is UTF-8. charset can be any encoding supported by the system's iconv library routine. 

-fwide-exec-charset=charset 
Set the wide execution character set, used for wide string and character constants. 
The default is UTF-32 or UTF-16, whichever corresponds to the width of wchar_t. As 
with -fexec-charset, charset can be any encoding supported by the system's iconv 
library routine; however, you will have problems with encodings that do not fit 
exactly in wchar_t. 

-finput-charset=charset 
Set the input character set, used for translation from the character set of the 
input file to the source character set used by GCC. If the locale does not specify, 
or GCC cannot get this information from the locale, the default is UTF-8. This can 
be overridden by either the locale or this command line option. Currently the command 
line option takes precedence if there's a conflict. charset can be any encoding 
supported by the system's iconv library routine. 
+0

मुझे आश्चर्य है अगर जब src और कार्यकारी एन्कोडिंग डिफ़ॉल्ट UTF-8 है, यह वास्तव में स्ट्रिंग शाब्दिक रूप में अच्छी तरह मान्य करता है जैसे विकल्प को शामिल किया है यूटीएफ -8-स्वरूपित है और अगर इसमें अमान्य बाइट अनुक्रम शामिल हैं - या यह अमान्य बाइट्स को गुजरने देता है या नहीं। –

संबंधित मुद्दे