End of line is cut after first special character by copying
End of line is cut after first special character by copying
I write a text with special (german) characters (ä ö ü ß) in TDBRichViewEdit 12.04 (e.g. 'My name is Jürgen').
Now I copy this text and insert him into a new mail ((format: Rich-Text (HTML)) of winMail.exe.
Inserted Text (of a paragraph) is cut after the first special character.
This also happens with the other paragraphs.
Sample: My name is Jürgen
Copied text is My name is J
If I change format (in winMail) to 'Nur-Text' and insert copied text the whole line is copied (My name is Jürgen)
Now I copy this text and insert him into a new mail ((format: Rich-Text (HTML)) of winMail.exe.
Inserted Text (of a paragraph) is cut after the first special character.
This also happens with the other paragraphs.
Sample: My name is Jürgen
Copied text is My name is J
If I change format (in winMail) to 'Nur-Text' and insert copied text the whole line is copied (My name is Jürgen)
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This problem occurs when I copy text to MS Word 7.Sergey Tkachenko wrote:Does this problem occur when you copy to WordPad or MS Word?
If I copy text (from TDBRichViewEdit) first to MS Word 7 (+ MS Word 2002) and then I copy text from MS Word 7 (+ MS Word 2002) to eMail all OK.
[img]d:\copy2MsWord.jpg[/img]
(I don't know how to show a picture in this memo thought you give a hint --> [img]http://image_url[/img])
Please tell me how. Picture was save at D:/ (d:\copy2MsWord.jpg).
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I use Delphi 7.1 and RichView 12.0.4Sergey Tkachenko wrote:It looks like WinMail has a bug in reading RTF.
Unfortunately, I do not have Windows 7 yet to test.
What version of Delphi do you use? It is important whether you use Unicode text or not, because non-English characters are saved in RTF differently depending on text type.
If I change in memo.RTFReadProperties UseCharsetToUnicode to YES
text is no langer cut after first special character ('My name is J') therefore special character ('ü') is lost ('My name is Jrgen')
(.UnicodeMode is set to rvrumixed)
In memo.options.rvoCopyAutotext is set to true and
in memo.options.rvoCopyAutoUnicodeText=true'
In memo.RTFOptions.rvRtfDuplicateUnicode ist set to true
And now ?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I suggest you to use Unicode in RichViewEdit, as explained in http://www.trichview.com/forums/viewtop ... t=70#11569
I tried about 1 h. Then I start your demo '\RichView\Demos\DelphiUnicode\Editors\Editor 2\REditor.exe'Sergey Tkachenko wrote:I suggest you to use Unicode in RichViewEdit, as explained in http://www.trichview.com/forums/viewtop ... t=70#11569
I put my text (
'Jüäöß and ...'
'My name is Jürgen and I ...')
in (REditor.exe-)memo.
Now I mark and copy (Strg+c) this text to Windows Mail (outlook) and I get then same result:
'J and ...'
'My name is Jrgen and I ...'
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I have sent the results to you (richview@gmail.com).Sergey Tkachenko wrote:Please add a button in this demo for saving to RTF
(rve.SaveRTF('test.rtf', False)) and send the resulting RTF to me.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Solution from Sergey:Sergey Tkachenko wrote:I received your e-mails. I'll try answering tomorrow.
If you use Vista or Win7 and WinMail change RVStyle.DefCodePage to 1252.
By default, this property equals to 0. It should mean "default code page", but it looks like it makes WinMail to ignore all non-English characters.
Normally, DefCodePage property is used to define a code page for conversion between Unicode and non-Unicode text in TRichView.
For example, if you use SearchText to search non-Unicode string, and document is in Unicode, this string will be converted to Unicode using this code page before comparing with Unicode text. Another example of using this code page is storing Unicode document to non-Unicode text file.
If your documents contain only Western text, 1252 is ok (this is a code page for West European languages).
But if, for example, you have a Russian users working with Russian text, they need 1251 code page.
What's why the default value is 0 (system-default code page).
Probably, if you have international users, it makes sense to assign this code page only when copying to WinMail.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks, j&b.
A little more explanation.
RTF contains \ansicpg keyword specifying a code page to Unicode <--> ANSI conversion. TRichView writes the value of RVStyle.DefCodePage there (because this value has the same meaning in TRichView).
The default value of RVStyle.DefCodePage is 0, meaning CP_ACP. This value instructs to use a system default language (specified in the Control Panel).
This value works ok for all known RTF readers, except for, as it appeared, Vista's WinMail. With this value, WinMail ignores non-English characters in pasted RTF.
I think this is a WinMail bug, but probably I will change my code for compatibility with WinMail. As a quick solution, you can assign a valid code page to RVStyle.DefCodePage, but this will affect all cases of Unicode <--> ANSI conversions in TRichView.
A little more explanation.
RTF contains \ansicpg keyword specifying a code page to Unicode <--> ANSI conversion. TRichView writes the value of RVStyle.DefCodePage there (because this value has the same meaning in TRichView).
The default value of RVStyle.DefCodePage is 0, meaning CP_ACP. This value instructs to use a system default language (specified in the Control Panel).
This value works ok for all known RTF readers, except for, as it appeared, Vista's WinMail. With this value, WinMail ignores non-English characters in pasted RTF.
I think this is a WinMail bug, but probably I will change my code for compatibility with WinMail. As a quick solution, you can assign a valid code page to RVStyle.DefCodePage, but this will affect all cases of Unicode <--> ANSI conversions in TRichView.