找回密码
 点一下
楼主: 啊丹

[公告测试]感谢Lars GreedWind WC3C的Zoxc 论坛已支持触发JASS高亮显示 欢迎大家测试

  [复制链接]
发表于 2006-4-2 22:54:35 | 显示全部楼层
[trigger]
Quest2 Discovered
    浜?欢
    ???
        (浠诲?Q_JiaMeng[TempQuestActionIndex] ??????) 绛?? ??True)
        (浠诲?Q_JiaMengRenWu1[TempQuestActionIndex] ??凡缁???扮?) 绛?? ??False)
        (?遍? RoleByPlayer[TempQuestActionIndex] ???绾? 澶т????绛??QuestRuqLV[2]
    ?ㄤ?
        浠诲? - 璁剧疆 Q_JiaMengRenWu1[TempQuestActionIndex] 涓???ず
        浠诲? - ?剧ず (?╁?缁?Player[TempQuestActionIndex]))  ???浠诲? 娑??: |cffffcc00???浠?..
        浠诲? - 浣夸换?℃??????



[/trigger]

[ 本帖最后由 蚊子叮 于 2006-4-2 22:56 编辑 ]
回复

使用道具 举报

发表于 2006-4-2 23:12:58 | 显示全部楼层
呃。还是没支持utf8.嗯嗯。
回复

使用道具 举报

发表于 2006-4-3 09:12:15 | 显示全部楼层
原帖由 啊丹 于 2006-4-2 18:48 发表
[code]        If (GoldbachsTrueOrFalse Equal to True) then do (Game - Display to (All players) for 60.00 seconds the text: ((|cffffcc00 + (Substring((Entered chat string), 2, (Length of (Entered ch ...

是Goldbach\'s中的 \' 号引起的
回复

使用道具 举报

发表于 2006-4-3 09:13:30 | 显示全部楼层
原帖由 白银の游戏王 于 2006-4-2 16:32 发表


偶只有C#版的...


给我参考一下?

记得MYSQL 内置好像ANSI ->UNICODE的库文件
回复

使用道具 举报

发表于 2006-4-3 13:20:49 | 显示全部楼层
似乎现在的数据库都支持转换编码
有个VB的
http://www.mndsoft.com/blog/blogview.asp?logID=492

解决多国语言乱码的编码问题   [ 2005-08-20 | 作者:Mndsoft | 来自:本站转载]
  

忙呼了几天,终于解决多国语言乱码的编码问题

open  方法打开文本文件经常遇到乱码问题,今天俺尝试打开一法文文本 和 英文文本,notepad 中出现问题,后来在 CSDN 重赏,竟然无人能解决.,查了两天,也无结果.无意中在 microsoft msdn 新闻组中发现 adodb.stream 在上传下载中可以进行 charset , 正合吾意, 马上试试,果然成功.

不要用 StrConv(InputB$(LOF(hFile), #hFile), vbUnicode) 这种方式来解决问题,因为你打开的文本编码是不确定的,另外还存在大容量文本的问题.

现归纳成如下函数,该函数能解决由于 utf-8,unicode,ansi,..... 等任何已知编码出现的乱码问题.

\'http://spaces.msn.com/members/standardtrip
Function UTFDecode(filePathName As String, writeCode As String, readCode As String) As String
    Dim adoSd As ADODB.Stream
    Set adoSd = New ADODB.Stream
\'   adoSd.Mode = adModeRecursive
    adoSd.Type = adTypeText
    adoSd.Open
    adoSd.Charset = writeCode \'UTF-8
   
    adoSd.LoadFromFile filePathName
    adoSd.Position = 0
    adoSd.Charset = readCode \'gb2312
    UTFDecode = adoSd.ReadText
    adoSd.Close
    Set adoSd = Nothing
End Function
回复

使用道具 举报

发表于 2006-4-3 17:36:38 | 显示全部楼层
使用系统功能的无参考价值的
要从BYTE分析
回复

使用道具 举报

发表于 2006-4-4 10:20:56 | 显示全部楼层
太专业了~~不的不拜!!
回复

使用道具 举报

发表于 2006-4-4 10:21:42 | 显示全部楼层
[trigger]Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Melee Game - Use melee time of day (for all players)
        Melee Game - Limit Heroes to 1 per Hero-type (for all players)
        Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
        Melee Game - Set starting resources (for all players)
        Melee Game - Remove creeps and critters from used start locations (for all players)
        Melee Game - Create starting units (for all players)
        Melee Game - Run melee AI scripts (for computer players)
        Melee Game - Enforce victory/defeat conditions (for all players)
[/trigger]
回复

使用道具 举报

发表于 2006-4-4 10:24:32 | 显示全部楼层
拉啦啦~~成功~~
回复

使用道具 举报

 楼主| 发表于 2006-4-4 11:25:57 | 显示全部楼层
[jass]function Trig_Shape_Shift_Meta_Conditions takes nothing returns boolean
    return (( GetSpellAbilityId() == \'A607\' ) or ( GetSpellAbilityId() == \'A608\' ))
endfunction

function Trig_Shape_Shift_Dragon_SelectUnits takes nothing returns nothing
    call SelectUnitAdd( GetEnumUnit() )
endfunction

function Trig_Shape_Shift_Meta_Actions takes nothing returns nothing
    local unit u_caster = GetSpellAbilityUnit()
    local group selection
    local integer HeroID = 2
    local integer i
    local integer j
    local integer k
    local real    distance
    local group   selection
    local boolean item_on_ground

    if ( GetUnitTypeId(u_caster) == \'E601\' ) then
        set HeroID = 1
    endif
    //call IssueImmediateOrderBJ( udg_Heroes[HeroID], \"holdposition\" )
    set selection = GetUnitsSelectedAll(Player(0))
    //Make sure you can land
    call SetUnitPositionLocFacingBJ( udg_Heroes[3 - HeroID], GetUnitLoc(udg_Heroes[HeroID]), GetUnitFacing(udg_Heroes[HeroID]) )
    set distance = DistanceBetweenPoints(GetUnitLoc(udg_Heroes[1]), GetUnitLoc(udg_Heroes[2]))
    if ( distance > 300 ) then
        call SetUnitManaBJ( udg_Heroes[HeroID], ( GetUnitStateSwap(UNIT_STATE_MANA, udg_Heroes[HeroID]) + 50.00 ) )
        call DisplayTextToForce( GetPlayersAll(), \"Cannot transform to spider form - Cannot land here\" )
        return
    endif[/jass]
回复

使用道具 举报

发表于 2006-4-4 13:31:23 | 显示全部楼层
eGust用delphi写的。我看不懂。好像是用指针操作的。


  1. function A2U(us:PChar):PChar;
  2. var
  3.   ws    : PWCHAR;
  4.   cs    : PChar;
  5.   nLen  : integer;
  6. begin
  7.   nLen := MultiByteToWideChar(CP_ACP, 0, us, -1, nil, 0);
  8.   GetMem(ws, Sizeof(WCHAR) * (nLen + 2));
  9.   MultiByteToWideChar(CP_ACP, 0, us, -1, ws, nLen);
  10.   nLen := WideCharToMultiByte(CP_UTF8, 0, ws, -1, nil, 0, nil, nil);
  11.   if bolHaveHead then
  12.   begin
  13.     GetMem(cs, Sizeof(char) * (nLen + 4));
  14.     Result := cs;
  15.     cs^ := #$ef;
  16.     Inc(cs);
  17.     cs^ := #$bb;
  18.     Inc(cs);
  19.     cs^ := #$bf;
  20.     Inc(cs);
  21.   end else
  22.   begin
  23.     GetMem(cs, Sizeof(char) * (nLen + 1));
  24.     Result := cs;
  25.   end;
  26.   WideCharToMultiByte(CP_UTF8, 0, ws, -1, cs, nLen, nil, nil);
  27.   FreeMem(ws);
  28. end;

  29. function U2A(us:PChar):PChar;
  30. var ws:PWCHAR;cs:PChar;nLen:integer;
  31. begin
  32.   if us^=#$ef then
  33.   begin
  34.     Inc(us);
  35.     if us^=#$bb then
  36.     begin
  37.       Inc(us);
  38.       bolHaveHead := us^=#$bf;
  39.       if bolHaveHead then
  40.         Inc(us)
  41.       else
  42.         Dec(us, 2);
  43.     end
  44.     else
  45.       Dec(us);
  46.   end;
  47.   nLen := MultiByteToWideChar(CP_UTF8, 0, us, -1, nil, 0);
  48.   GetMem(ws, sizeof(WCHAR) * (nLen + 2));
  49.   MultiByteToWideChar(CP_UTF8, 0, us, -1, ws, nLen);
  50.   nLen := WideCharToMultiByte(CP_ACP, 0, ws, -1, nil, 0, nil, nil);
  51.   GetMem(cs, sizeof(char) * (nLen + 3));
  52.   Result  := cs;
  53.   WideCharToMultiByte(CP_ACP, 0, ws, -1, cs, nLen, nil, nil);
  54. end;
复制代码
回复

使用道具 举报

发表于 2006-4-4 13:50:43 | 显示全部楼层
关键就素一个API:MultiByteToWideChar
回复

使用道具 举报

发表于 2006-4-4 13:56:36 | 显示全部楼层
原帖由 白银の游戏王 于 2006-4-4 13:50 发表
关键就素一个API:MultiByteToWideChar

又是一个系统函数,
不过PHP也又iconv()

不过,我就是搞不懂他的codepage的对应。
回复

使用道具 举报

发表于 2006-4-4 14:32:45 | 显示全部楼层
呃。因为没学过php。所以不知道php用的函数和系统无关。
还有这几句也不明白。
    cs^ := #$ef;
    Inc(cs);
    cs^ := #$bb;
    Inc(cs);
    cs^ := #$bf;
    Inc(cs);
不懂#$是什么意思。。
回复

使用道具 举报

发表于 2006-4-4 23:35:37 | 显示全部楼层
[trigger]function Trig________________u_Actions takes nothing returns nothing     call MeleeStartingVisibility(  )[/trigger]
怎么搞的 不明白 发个教程八

[ 本帖最后由 piky 于 2006-4-4 23:38 编辑 ]
回复

使用道具 举报

发表于 2006-4-4 23:40:45 | 显示全部楼层
看来是我太蠢了 管理的来一下 教下
发个图八 不懂
回复

使用道具 举报

发表于 2006-4-4 23:48:54 | 显示全部楼层
教程?
就是复制为文本。
copy to text。
好像。应该是这样吧。我没英文版的。而且只支持英文版。中文版还没完全搞好。
回复

使用道具 举报

发表于 2006-4-4 23:53:12 | 显示全部楼层
我说的是怎么贴道论坛 然后可以展开 按了楼主说的地方然后要干什么啊 不懂啊
回复

使用道具 举报

发表于 2006-4-5 00:00:37 | 显示全部楼层
什么叫然后要干什么。就是粘来给大家容易看明白。
回复

使用道具 举报

发表于 2006-4-5 14:38:37 | 显示全部楼层
原帖由 amp34 于 2006-4-4 14:32 发表
呃。因为没学过php。所以不知道php用的函数和系统无关。
还有这几句也不明白。
    cs^ := #$ef;
    Inc(cs);
    cs^ := #$bb;
    Inc(cs);
    cs^ := #$bf;
    Inc(cs);
不懂#$是什么意思。。


#$是字符转义符

该代码写成C语言是:

  1. *cs++ = \'0xEF\';
  2. *cs++ = \'0xBB\';
  3. *cs++ = \'0xBF\';
复制代码



由于它是UTF-8编码,所以是这样解析:

字节:EF BB BF
位:1110 1111 1011 1011 1011 1111
分离出Unicode的位:1111 1110 1111 1111
写成十六进制形式是:0xFEFF


uFEFF 这个字符叫做BOM(BYTE ORDER MARK)字符
是用来描述 Unicode文本编码方式(UTF) 的:

以 FF FE 开头的是 UTF-16LE(就是俗称的Unicode编码,16位一个字符)
以 FE FF 开头的是 UTF-16BE
以 FF FE 00 00 开头的是 UTF-32LE
以 00 00 FE FF 开头的是 UTF-32BE
以 EF BB BF 开头的是 UTF-8


Unicode官方网站:www.unicode.org

[ 本帖最后由 zyl910 于 2006-4-5 18:28 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-10-1 12:04 , Processed in 0.095701 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表