के साथ यूटीएफ -8 त्रुटि मैं अपने संपादक में यूटीएफ -8 का उपयोग करता हूं, इसलिए यहां प्रदर्शित सभी स्ट्रिंग्स यूटीएफ -8 फाइल में हैं।पाइथन और गेटटेक्स्ट
# -*- coding: utf-8 -*-
...
parser = optparse.OptionParser(
description=_('automates the dice rolling in the classic game "risk"'),
usage=_("usage: %prog attacking defending"))
तब मैं xgettext इस्तेमाल किया सब कुछ बाहर निकलने के लिए और एक पॉट फाइल जो करने के लिए नीचे उबला हुआ जा सकता है मिल गया:
मैं इस तरह एक अजगर स्क्रिप्ट है
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: auto_dice.py:16
msgid "automates the dice rolling in the classic game \"risk\""
msgstr ""
उसके बाद,
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: auto_dice.py:16
msgid "automates the dice rolling in the classic game \"risk\""
msgstr "automatisiert das Würfeln bei \"Risiko\""
चल रहा है: मैं एक de.po
जो मैं इस तरह में भर पाने के लिए इस्तेमाल किया msginit स्क्रिप्ट, मुझे निम्न त्रुटि मिलती है:
File "/usr/lib/python2.6/optparse.py", line 1664, in print_help
file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 60: ordinal not in range(128)
मैं इसे कैसे ठीक कर सकता हूं?
की '_ (प्रकार क्या है।" उपयोग:% prog बचाव पर हमला ")'? यानी 'प्रिंट प्रकार (_ ("उपयोग:% प्रॉग हमलावर हमलावर" क्या करता है)' प्रिंट? – Mikel