Pasting from MS Word to Text Area causes error
Pasting from MS Word to Text Area causes error
A frequent problem encountered by users is an error similar to the attachment when pasting text from MS Word or PDF. Has anyone nailed this down for a fix?
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
Re: Pasting from MS Word to Text Area causes error
I also get this in some situations, primarily when trying to copy strings from a Wordpress DB into a Aware DB. Support or anyone know what this is and how to solve it? I guess it has to do with character/charset incompability between the 2 mediums.
Henrik (V8 Developer Ed. - Windows)
Re: Pasting from MS Word to Text Area causes error
Have had similar issues when copy pasting from Sharepoint sites or doing csv imports.
Most often it had to do with a strange space or line break characters.
We did not find an automatic solution. The two methods we used:
* Figuring out what the faulty encoded characters were, and then search replaced them with notepad++ or excel (if they were lists).
* Copy pasting text to a notepad document so that the text became sanitized, unformatted, etc. Then we copy pasted that into AwareIM.
Both of these methods were time-consuming and just felt plain wrong, but this is the best we could come up with.
Most often it had to do with a strange space or line break characters.
We did not find an automatic solution. The two methods we used:
* Figuring out what the faulty encoded characters were, and then search replaced them with notepad++ or excel (if they were lists).
* Copy pasting text to a notepad document so that the text became sanitized, unformatted, etc. Then we copy pasted that into AwareIM.
Both of these methods were time-consuming and just felt plain wrong, but this is the best we could come up with.
Re: Pasting from MS Word to Text Area causes error
I have also found that you can copy the text to Notepad and save it as ANSI, then paste into the text area okay. I could do a REPLACE_PATTERN() but not sure what I'm looking for.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
-
- Posts: 1471
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Pasting from MS Word to Text Area causes error
AIM errors like that tend to suggest a database issue. What is the underlying text encoding of the database?
Re: Pasting from MS Word to Text Area causes error
In my case, MySQL, utf8
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit
-
- Posts: 1471
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Pasting from MS Word to Text Area causes error
It seems like MySQL has common problems with some Unicode characters (google 'xF0\x9F\x87\xBa\xF0\x9F')
What is the text encoding that you are pasting in?
Try this to get the encoding
https://www.webatic.com/encoding-explorer
(no warranties as to its efficacy)
What is the text encoding that you are pasting in?
Try this to get the encoding
https://www.webatic.com/encoding-explorer
(no warranties as to its efficacy)
Re: Pasting from MS Word to Text Area causes error
if you decide to remove those characters, the following will do it:
That will remove the 'xF0\x9F\x87\xBa\xF0\x9F' that were in you gif plus any other formatting or control characters.
It will also remove any tabs or new line characters. If those are needed, the REPLACE_PATTERN can be tweaked to keep those.
FYI: here is one of many sites that displays ascii codes: https://www.ascii-code.com/
Code: Select all
ExecutiveSummary.Narrative=REPLACE_PATTERN(REPLACE_PATTERN(ExecutiveSummary.Narrative, '[\x00-\x1F]', ''), '[\x7F-\xFF]', '')
It will also remove any tabs or new line characters. If those are needed, the REPLACE_PATTERN can be tweaked to keep those.
FYI: here is one of many sites that displays ascii codes: https://www.ascii-code.com/
Bob
Re: Pasting from MS Word to Text Area causes error
Thanks BobK, but over the years, I have seen a plethora of characters presented to the user with this error. It doesn't seem I can address every potentiality.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
MySQL, AWS EC2, S3
PDFtk Toolkit