Ticket #20 (new defect)

Opened 3 years ago

Last modified 3 years ago

导出为 flash,保存的 HTML 网页名称不能包含中文

Reported by: jiangxin Owned by: jiangxin
Priority: major Milestone: Next Release
Component: FreeMind Version:
Keywords: Cc: flyskywhy

Description

flyskywhy 报告:

问题描述如下:
如果.mm文件中含有中文名,那么在导出Flash时的文件名默认也是那个中文名,
此时导出的Flash网页打开时看不到脑图,如果在导出时不用默认的中文名,
而是写入一个英文名,则导出的Falsh网页可以看到脑图。

参见 ticket:18#comment:12

Attachments

flashtest.7z (38.9 KB) - added by jiangxin 3 years ago.

Change History

comment:1 Changed 3 years ago by jiangxin

实际上这个问题不是 FreeMind 本身的问题。问题出自于浏览器对 URL 中出现的非 ascii 字符的处理问题。

各个浏览器实现的标准不一样。我在 MoinMoin? 的附件下载遇到类似的问题,并且写了一个补丁,参见:

Changed 3 years ago by jiangxin

comment:2 Changed 3 years ago by jiangxin

  • cc flyskywhy added set to flyskywhy

请下载文件 attachment:flashtest.7z ,测试浏览器显示中文文件名 flash 脑图兼容性:

  • 压缩包 attachment:flashtest.7z ,是经过 7zip 压缩。(7zip压缩包能够在 windows 和 linux 下通用,比 rar 和 zip 强太多了)
  • 解压缩后,总共有五个 html 文件,请逐一测试。
  • 报告:
    1. 操作系统平台(linux/windows, 32位/64位)
    2. 浏览器类型 (IE 6, IE 7, FireFox? 2, FF3, Chrome, Safari, Opera, Epiphany, …)
    3. 以及可以显示 flash 的网页名,或者都无法显示?

我初步测试发现:

  • 导出的 HTML 中涉及到的中文路径经 urlencode 之后,在 Google Chrome 中可以显示脑图。
    • 总共三处需要替换:一是 Javascript 地址;
    • 二是 flash object 地址;
    • 三是 脑图地址;
  • Firefox 在地址经过 urlencode 之后也可以正常显示;
  • IE 则是无论用 urlencode 处理路径,还是保持 utf8 的地址,都不能显示 Flash!(倒霉的IE)

原始文件,未经 urlencode 对中文路径进行处理:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>新建思维导图</title>

<script type="text/javascript" src="./新建思维导图.html_files/flashobject.js"> </script><style type="text/css">

... ...

<script type="text/javascript">
        var fo = new FlashObject("./新建思维导图.html_files/visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#9999ff");
        fo.addParam("quality", "high");
        fo.addParam("bgcolor", "#ffffff");
        fo.addVariable("openUrl", "_blank");
        fo.addVariable("initLoadFile", "./新建思维导图.html_files/map.mm");
        fo.addVariable("startCollapsedToLevel","5");
        fo.write("flashcontent");
    </script></body></html>

经 urlencode 对中文路径进行处理:

<script type="text/javascript" src="./%E6%96%B0%E5%BB%BA%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE.html_files/flashobject.js"> </script><style type="text/css">

... ...

<script type="text/javascript">
        var fo = new FlashObject("./%E6%96%B0%E5%BB%BA%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE.html_files/visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#9999ff");

... ...

        fo.addVariable("initLoadFile", "./%E6%96%B0%E5%BB%BA%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE.html_files/map.mm");

... ...
Note: See TracTickets for help on using tickets.