MCPcopy Create free account
hub / github.com/LibreCAD/LibreCAD / getEncoding

Method getEncoding

librecad/src/lib/engine/rs_system.cpp:764–866  ·  view source on GitHub ↗

* Tries to convert the given encoding string to an encoding Qt knows. */

Source from the content-addressed store, hash-verified

762 * Tries to convert the given encoding string to an encoding Qt knows.
763 */
764QString RS_System::getEncoding(const QString& str) {
765 QString l=str.toLower();
766
767 if (l=="latin1" || l=="ansi_1252" || l=="iso-8859-1" ||
768 l=="cp819" || l=="csiso" || l=="ibm819" || l=="iso_8859-1" ||
769 l=="iso8859-1" || l=="iso-ir-100" || l=="l1") {
770 return "Latin1";
771 } else if (l=="big5" || l=="ansi_950" || l=="cn-big5" || l=="csbig5" ||
772 l=="x-x-big5") {
773 return "Big5";
774 } else if (l=="big5-hkscs") {
775 return "Big5-HKSCS";
776 } else if (l=="eucjp" || l=="euc-jp" || l=="cseucpkdfmtjapanese" ||
777 l=="x-euc" || l=="x-euc-jp") {
778 return "eucJP";
779 } else if (l=="euckr") {
780 return "eucKR";
781 } else if (l=="gb2312" || l=="chinese" || l=="cn-gb" ||
782 l=="csgb2312" || l=="csgb231280" || l=="csiso58gb231280" ||
783 l=="gb_2312-80" || l=="gb231280" || l=="gb2312-80" || l=="gbk" ||
784 l=="iso-ir-58") {
785 return "GB2312";
786 } else if (l=="gbk") {
787 return "GBK";
788 } else if (l=="gb18030") {
789 return "GB18030";
790 } else if (l=="jis7") {
791 return "JIS7";
792 } else if (l=="shift-jis" || l=="ansi_932" || l=="shift_jis" || l=="csShiftJIS" ||
793 l=="cswindows31j" || l=="ms_kanji" || l=="x-ms-cp932" || l=="x-sjis") {
794 return "Shift-JIS";
795 } else if (l=="tscii") {
796 return "TSCII";
797 } else if (l=="utf88-bit") {
798 return "utf88-bit";
799 } else if (l=="utf16") {
800 return "utf16";
801 } else if (l=="utf8" || l=="utf-8") {
802 return "utf-8";
803 } else if (l=="koi8-r") {
804 return "KOI8-R";
805 } else if (l=="koi8-u") {
806 return "KOI8-U";
807 } else if (l=="iso8859-1") {
808 return "ISO8859-1";
809 } else if (l=="iso8859-2") {
810 return "ISO8859-2";
811 } else if (l=="iso8859-3") {
812 return "ISO8859-3";
813 } else if (l=="iso8859-4" || l=="ansi_1257") {
814 return "ISO8859-4";
815 } else if (l=="iso8859-5") {
816 return "ISO8859-5";
817 } else if (l=="iso8859-6" || l=="ansi_1256") {
818 return "ISO8859-6";
819 } else if (l=="iso8859-7" || l=="ansi_1253") {
820 return "ISO8859-7";
821 } else if (l=="iso8859-8") {

Callers 2

fileImportMethod · 0.45
fileImportMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected