Commit 92952b70 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Use UTF-8 encoding only in kicad files. Under Linux, this was already the...

Use UTF-8 encoding only in kicad files. Under Linux, this was already the case. Under Windows, texts with  non ascii characters must be corrected.
This ensure compatibility between platforms.
parent ffa9feda
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -789,7 +789,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )

            default:
                s.Printf( wxT( "Error: Shape nr %d not implemented!\n" ), m_Shape );
                D( printf( "%s", CONV_TO_UTF8( s ) ); )
                D( printf( "%s", TO_UTF8( s ) ); )
                    break;
            }
        }
@@ -837,7 +837,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )

        default:
            s.Printf( wxT( "Error: Shape nr %d not implemented!\n" ), m_Shape );
            D( printf( "%s", CONV_TO_UTF8( s ) ); )
            D( printf( "%s", TO_UTF8( s ) ); )
                break;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ int S3D_MASTER:: ReadMaterial( FILE* file, int* LineNum )

    command  = strtok( NULL, " \t\n\r" );
    text     = strtok( NULL, " \t\n\r" );
    mat_name = CONV_FROM_UTF8( text );
    mat_name = FROM_UTF8( text );
    if( stricmp( command, "USE" ) == 0 )
    {
        for( material = m_Materials; material; material = material->Next() )
+1 −1
Original line number Diff line number Diff line
@@ -379,7 +379,7 @@ void EDA_BASE_FRAME::CopyVersionInfoToClipboard( wxCommandEvent& event )
    tmp = wxT( "Application: " ) + wxGetApp().GetTitle() + wxT( "\n" );
    tmp += wxT( "Version: " ) + GetBuildVersion() + wxT( "\n" );
    tmp << wxT( "Build: " ) << wxVERSION_STRING
        << CONV_FROM_UTF8( KICAD_BUILD_OPTIONS_SIGNATURE() ) << wxT( "\n" )
        << FROM_UTF8( KICAD_BUILD_OPTIONS_SIGNATURE() ) << wxT( "\n" )
        << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " )
        << info.GetArchName() << wxT( ", " ) << info.GetEndiannessName() << wxT( ", " )
        << info.GetPortIdName();
+7 −7
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ bool DXF_PLOTTER::start_plot( FILE* fout )
    {
        wxString cname = ColorRefs[i].m_Name;
        fprintf( output_file, "0\nLAYER\n2\n%s\n70\n0\n62\n%d\n6\nCONTINUOUS\n",
                 CONV_TO_UTF8( cname ), i + 1 );
                 TO_UTF8( cname ), i + 1 );
    }

    /* End of layer table, begin entities */
@@ -97,17 +97,17 @@ void DXF_PLOTTER::circle( wxPoint centre, int diameter, FILL_T fill, int width )
        wxString cname = ColorRefs[current_color].m_Name;
        if (!fill) {
          fprintf( output_file, "0\nCIRCLE\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%g\n",
                  CONV_TO_UTF8( cname ),
                  TO_UTF8( cname ),
                  centre.x, centre.y, radius );
        }
        if (fill == FILLED_SHAPE) {
            int r = (int)(radius*0.5);
            fprintf( output_file, "0\nPOLYLINE\n");
            fprintf( output_file, "8\n%s\n66\n1\n70\n1\n", CONV_TO_UTF8( cname ));
            fprintf( output_file, "8\n%s\n66\n1\n70\n1\n", TO_UTF8( cname ));
            fprintf( output_file, "40\n%g\n41\n%g\n", radius,radius);
            fprintf( output_file, "0\nVERTEX\n8\n%s\n", CONV_TO_UTF8( cname ));
            fprintf( output_file, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
            fprintf( output_file, "10\n%d.0\n 20\n%d.0\n42\n1.0\n", centre.x-r,centre.y);
            fprintf( output_file, "0\nVERTEX\n8\n%s\n", CONV_TO_UTF8( cname ));
            fprintf( output_file, "0\nVERTEX\n8\n%s\n", TO_UTF8( cname ));
            fprintf( output_file, "10\n%d.0\n 20\n%d.0\n42\n1.0\n", centre.x+r,centre.y);
            fprintf( output_file, "0\nSEQEND\n");
    }
@@ -160,7 +160,7 @@ void DXF_PLOTTER::pen_to( wxPoint pos, char plume )
        /* DXF LINE */
        wxString cname = ColorRefs[current_color].m_Name;
        fprintf( output_file, "0\nLINE\n8\n%s\n10\n%d.0\n20\n%d.0\n11\n%d.0\n21\n%d.0\n",
                 CONV_TO_UTF8( cname ),
                 TO_UTF8( cname ),
                 pen_lastpos.x, pen_lastpos.y, pos.x, pos.y );
    }
    pen_lastpos = pos;
@@ -214,7 +214,7 @@ void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,
    wxString cname = ColorRefs[current_color].m_Name;
    fprintf( output_file,
             "0\nARC\n8\n%s\n10\n%d.0\n20\n%d.0\n40\n%d.0\n50\n%d.0\n51\n%d.0\n",
             CONV_TO_UTF8( cname ),
             TO_UTF8( cname ),
             centre.x, centre.y, radius,
             StAngle / 10, EndAngle / 10 );
}
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ bool GERBER_PLOTTER::start_plot( FILE* aFile )
    DateAndTime( Line );
    wxString Title = creator + wxT( " " ) + GetBuildVersion();
    fprintf( output_file, "G04 (created by %s) date %s*\n",
             CONV_TO_UTF8( Title ), Line );
             TO_UTF8( Title ), Line );

    // Specify linear interpol (G01), unit = INCH (G70), abs format (G90):
    fputs( "G01*\nG70*\nG90*\n", output_file );
Loading