Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LenweSaralonde/d51e415df69bb1fc9ab6eb4de85cedfe to your computer and use it in GitHub Desktop.
Save LenweSaralonde/d51e415df69bb1fc9ab6eb4de85cedfe to your computer and use it in GitHub Desktop.
String with special characters truncated when sent with C_ChatInfo.SendAddonMessage() over SAY and YELL
-- Reproduction steps
-- Each line can be entered in game with the /run command
-- https://github.com/Stanzilla/WoWUIBugs/issues/23
C_ChatInfo.RegisterAddonMessagePrefix("BlzBug");
local f = CreateFrame("Frame"); f:RegisterEvent("CHAT_MSG_ADDON"); f:SetScript("OnEvent", function(self, event, prefix, text, channel) print("Received", event, prefix, string.len(text), channel, text) end);
-- All characters from 1 to 255 allowed by SendAddonMessage()
ALL_MSG_ADDON_CHARS = ''; local i; for i=1,255 do ALL_MSG_ADDON_CHARS = ALL_MSG_ADDON_CHARS .. string.char(i) end
C_ChatInfo.SendAddonMessage("BlzBug", ALL_MSG_ADDON_CHARS, "WHISPER", UnitName("player")) -- OK: All 255 characters received, WHISPER channel
C_ChatInfo.SendAddonMessage("BlzBug", ALL_MSG_ADDON_CHARS, "YELL") -- KO: Only 9 characters received, UNKNOWN channel. Expected: 255 characters, YELL channel
C_ChatInfo.SendAddonMessage("BlzBug", ALL_MSG_ADDON_CHARS, "SAY") -- KO: Only 9 characters received, UNKNOWN channel. Expected: 255 characters, SAY channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment