如何解决RichView导出Html看不到中文问题
2011-11-14 18:25
387 查看
1、 问题描述:
调用RichViewEdit.SaveHTMLToStream的方法可以生成html文件,但是默认导出的不是中文码,而是ASCII码。如何解决这个问题呢?
2、解决办法:
这个方法的最后一个参数可以用来解决这个问题
SaveHTMLToStream(Stream: TStream; const Path, Title, ImagesPrefix: String; Options: TRVSaveOptions):Boolean;
将Options参数设置为[rvsoUTF8]即可,参数说明如下:
{ Options for saving HTML files, TCustomRichView.SaveHTML and SaveHTMLEx methods }
TRVSaveOption = (
rvsoOverrideImages, // Overwrite image files (if not set - use unique)
rvsoFirstOnly, // Save only heading part of HTML
rvsoMiddleOnly, // Save only middle part of HTML (document itself)
rvsoLastOnly, // Save only ending part of HTML
rvsoDefault0Style, // Do not save properties for the 0-th text style
rvsoNoHypertextImageBorders, // Supress borders for hypertext images
rvsoImageSizes, // Write image size
rvsoForceNonTextCSS,// Always use CSS for non-text items
rvsoUseCheckpointsNames, // Use "checkpoint names" instead of indices
rvsoMarkersAsText, // Save paragraph bullets/numbering without <UL>/<OL>
rvsoInlineCSS, // Write CSS directly in <P> and <SPAN> tags
// (only for SaveHTMLEx)
rvsoNoDefCSSStyle, // Use named CSS for all text styles, even for
// TextStyles[0] (by default, properties of
// TextStyles[0] are assigned to BODY and TABLE).
// This option generates larger HTML (not recommended).
// (only for SaveHTMLEx)
rvsoUseItemImageFileNames, // If set, images having specified
// (in extra string properties) file names will not
// be saved, but their file names will be written
// in HTML (relative to the HTML file path)
rvsoXHTML, // Save XHTML
rvsoUTF8); // Use UTF8 encoding
TRVSaveOptions = set of TRVSaveOption;
调用RichViewEdit.SaveHTMLToStream的方法可以生成html文件,但是默认导出的不是中文码,而是ASCII码。如何解决这个问题呢?
2、解决办法:
这个方法的最后一个参数可以用来解决这个问题
SaveHTMLToStream(Stream: TStream; const Path, Title, ImagesPrefix: String; Options: TRVSaveOptions):Boolean;
将Options参数设置为[rvsoUTF8]即可,参数说明如下:
{ Options for saving HTML files, TCustomRichView.SaveHTML and SaveHTMLEx methods }
TRVSaveOption = (
rvsoOverrideImages, // Overwrite image files (if not set - use unique)
rvsoFirstOnly, // Save only heading part of HTML
rvsoMiddleOnly, // Save only middle part of HTML (document itself)
rvsoLastOnly, // Save only ending part of HTML
rvsoDefault0Style, // Do not save properties for the 0-th text style
rvsoNoHypertextImageBorders, // Supress borders for hypertext images
rvsoImageSizes, // Write image size
rvsoForceNonTextCSS,// Always use CSS for non-text items
rvsoUseCheckpointsNames, // Use "checkpoint names" instead of indices
rvsoMarkersAsText, // Save paragraph bullets/numbering without <UL>/<OL>
rvsoInlineCSS, // Write CSS directly in <P> and <SPAN> tags
// (only for SaveHTMLEx)
rvsoNoDefCSSStyle, // Use named CSS for all text styles, even for
// TextStyles[0] (by default, properties of
// TextStyles[0] are assigned to BODY and TABLE).
// This option generates larger HTML (not recommended).
// (only for SaveHTMLEx)
rvsoUseItemImageFileNames, // If set, images having specified
// (in extra string properties) file names will not
// be saved, but their file names will be written
// in HTML (relative to the HTML file path)
rvsoXHTML, // Save XHTML
rvsoUTF8); // Use UTF8 encoding
TRVSaveOptions = set of TRVSaveOption;
相关文章推荐
- DAY5 如何解决 html 里面中文乱码的问题
- Html 中表格导出生成excel文件,解决中文导出失败问题。
- html 之间如何通过URL传输参数,并解决中文乱码问题
- 利用itext导出HTML到PDF,解决中文不显示和中文不换行的问题
- JSP应用导出Excel报表的简单实现以及中文乱码彻底解决(HTML)(转)
- 如何解决hp-unix中文二级编码乱码问题("喆")?
- MySQL数据库中文乱码问题如何解决
- Win7下如何用Eclipse导出jar类型的文件,如何用鼠标双击打开jar类型的文件的方法及解决双击后一闪而过的问题
- Weblogic Server中如何解决中文显示乱码问题
- 如何解决JpGraph中文乱码的问题
- 关于Mysql中文乱码问题该如何解决(乱码问题完美解决方案)
- 如何解决MSSQL中文数据乱码问题
- 如何解决springmvc中文乱码问题
- 如何解决Sublime Text 3不能正确显示中文的问题
- <util:properties/>加载的配置文件中有中文导致乱码,如何通过分析源码解决问题?
- Oracle11g 数据库导入导出之中文乱码问题的解决
- MarkdownPad2中文破解版下载安装,并解决HTML渲染组件出错的问题
- 用 jdom 解析 xml 文件时如何解决中文问题 ? 如何解析 ?
- 如何解决Sublime Text 3不能正确显示中文的问题
- 解决html输入中文后,在myEclipse中打开乱码问题。