Electromagnetic scattering of an incident plane monochromatic wave by dielectric or finitely conducting infinite cylinders of arbitrary shape, possibly in the presence of a substrate, can be reduced to the solution of scalar Helmholtz equations in two dimensions for the parallel components of the fields as functions of the transverse coordinates. For one homogeneous scatterer, these equations reduce to an integral equation for a single function specified at the boundary of the cross section in the TE or TM modes. Two boundary functions are required for oblique incidence and arbitrary polarization. The number of boundary function also doubles at certain interfaces, although some of them can easily be eliminated from the final problem. We have applied these methods to scattering by one or more strips on a substrate, which is of interest to the semiconductor industry, and to the scattering by wedges of finite cross section. Sharp edges on the strips lead to divergent boundary functions, a problem that is related to divergent fields components at the edge of a wedge. A rigorous solution of the scattering by an infinite dielectric wedge might give us the asymptotic behavior of the unknown function at the edge of the wedge, which could be used near the edge in computations. A nonrigorous theory provides an asymptotic behavior for the fields, which is not supported by numerical experiments. The field behavior cannot be immediately applied to the boundary functions. We have used a hypersingular equation instead, for which the unknown function tends to a constant at the edge, but the difficulties with the divergent unknown function are shifted to complications due to the singularity of the kernel. The behavior of the unknown boundary functions near edges affects mainly the fields near the boundary, while the far fields are less sensitive to the details of the approximation. Another source of difficulties is the existence of solutions to the Maxwell equations in the interior of the cylinder at certain resonant frequencies. Spurious r4esonances appear at those frequencies in the scattering amplitudes for a circular cylinder, but not if the code for a cylinder in the boundary between two media is used by setting constants of the media equal to each other.