How to copy and paste inextricable spaces in different systems / browsers?

Suppose you have an HTML document with non-breaking spaces (   ). In IE 6-8, running on Windows XP, when you select non-breaking spaces and copy / paste them, they will be copied / pasted as β€œregular” spaces (U + 0020).

Does anyone know about any systems, browsers, etc. or combinations that will not exhibit this behavior. That is, non-breaking spaces will be copied and / or pasted as non-breaking space (U + 00A0)?

EDIT: To provide a little more context: the application I'm working on has been localized. I suspect that most of the North and South American and European systems will behave in a similar way. I am a bit concerned about Asian languages ​​and systems.

+4
source share
1 answer

While I don’t know the differences between browsers regarding how they handle copied / pasted text, I would suggest that this is actually an operating system clipboard that will be responsible for interpreting the character encoding of the text of the HTML page (just guess here, though )

In any case, I would suggest that your best way to ensure that your copied text is correctly interpreted is to include the lang attribute in your page elements (ref: W3C Guidelines ). This would explicitly set the locale for this element if it was not immediately visible from the declaration of the type of page content in the <head> metadata.

Except your HTML is semantically correct, I don’t see how else you could place or predict regional differences.

+1
source

All Articles