how to handle lua unicode parameter ? menu

User Tag List

Results 1 to 4 of 4
  1. #1
    leather's Avatar Member
    Reputation
    1
    Join Date
    Jun 2007
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to handle lua unicode parameter ?

    When I call lua_dostring with parameters in chinese wow client and korean wow client.it won't execute. for example:
    lua function :AddFirend("playername")
    when playername is english letter,it work perfectly.when playername is other character ,it won't work.

    AddFriend("당신을 사랑합니다") or AddFriend("我爱你")

    how to handle this?

    how to handle lua unicode parameter ?
  2. #2
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by leather View Post
    When I call lua_dostring with parameters in chinese wow client and korean wow client.it won't execute. for example:
    lua function :AddFirend("playername")
    when playername is english letter,it work perfectly.when playername is other character ,it won't work.

    AddFriend("당신을 사랑합니다") or AddFriend("我爱你")

    how to handle this?
    Wow uses UTF8 Encoding use that and it should work.
    Atleast it works when you read strings out of non english clients.

  3. #3
    goderion's Avatar Active Member
    Reputation
    25
    Join Date
    Oct 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nesox: Thanks for the Information.

    I got a similar problem by playernames with special letters, like äüö.

    The following is only an assumption, cant test it, couse im at work.

    You need to convert all UnicodeStrings send to a WoW-function like Lua_DoString to UTF8Strings.
    WinAPI: WideCharToMultiByte

    All Strings you get from WoW-functions like Lua_ToString are UTF8, so you need to convert them to Unicode.
    WinAPI: MultiByteToWideChar

  4. #4
    leather's Avatar Member
    Reputation
    1
    Join Date
    Jun 2007
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks to nesox & goderion.
    it worked now.

Similar Threads

  1. how to handle with beggars
    By pauk in forum World of Warcraft Guides
    Replies: 28
    Last Post: 07-03-2008, 01:49 PM
  2. [TuT] How to enable LUA with Compile
    By LordJedi in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 03-21-2008, 12:06 AM
  3. [Guide] How to make LUA portals easy and noobie too!
    By Ellenor in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 03-05-2008, 09:10 PM
  4. How to make lua scripted portals
    By *Alexz* in forum WoW EMU Guides & Tutorials
    Replies: 9
    Last Post: 02-18-2008, 06:05 PM
  5. [GUIDE] How to activate LUA scripts
    By ~SaiLyn~ in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-25-2007, 11:52 AM
All times are GMT -5. The time now is 11:59 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search