mouse-yank-primary and mouse-yank-secondary don't like inserting non-ascii chars from other apps. They need to use the slightly higher-level (x-selection-value 'PRIMARY) or at least give a 'TEXT arg to their (x-get-selection 'PRIMARY 'TEXT), so that the proper kinds of selection type are tried as e.g. attached.