Hi, Brent.
We tested more and tried to find solution. But, unfortunately we cannot found how to solve this issue.
(Including 2013.1256 enterprise and simulator iOS build)
Here’s my code actually using.
There’s no logic clipping, changing of string.
--... --------------------------- -- Read filter words from file local filterChat local path = system.pathForFile( 'etc/filterChat.txt', system.ResourceDirectory ) local fileObject, errStr = io.open( path, 'r' ) path = nil if fileObject == nil then -- no file no filtering filterChat = {} else local filterChatStr = fileObject:read( '\*a' ) -- split into array filterChat = lib.split( filterChatStr, '\n' ) filterChatStr = nil io.close( fileObject ) end -- 5783 words print('filterChat count: '..#filterChat) ------------------------------------- -- Validate input string local function validateChat( str ) if str == nil or str == '' then return false end if string.find(str, '[^%a%d%p%sㄱ-ㅎ가-힣]') ~= nil then -- cannot input character except english, number, korean lib:confirmCheck{ msg='영문, 숫자, 한글 이 외의 문자는 입력할 수 없어요', type='normal' } return false end -- 글자 수 local koreanByteSize = 0 for chr in string.gfind(str, '[ㄱ-ㅎ가-힣]') do koreanByteSize = koreanByteSize + 1 end local normalChar = 0 for word in string.gfind(str, '[%a%d%p%s]') do normalChar = normalChar + 1 end local byteCount = normalChar + (koreanByteSize/3)\*2 if byteCount \> 80 then lib:confirmCheck{ msg='입력 글자는 한글40자, 영문80자를 넘을 수 없어요', type='normal' } return false end -- 금칙어 체크 for i = #filterChat, 1, -1 do -- remove ? character from filter list if str:find( filterChat[i]:gsub('?', '') ) ~= nil then -- there's unallowed word lib:confirmCheck{ msg='금칙어가 포함되어 있습니다.', type='normal' } return false end end return true end --------------------------------------- -- input field self.ui.textField = native.newTextField( 60, 590-26, 650, 53, function(e) if e.phase == "began" then -- user begins editing textField if system.getInfo('platformName') == 'iPhone OS' then e.target.y = 270 end elseif e.phase == "ended" then -- textField/Box loses focus -- Hide keyboard native.setKeyboardFocus( nil ) if system.getInfo('platformName') == 'iPhone OS' then e.target.y = 590 end elseif e.phase == "submitted" then -- Hide keyboard native.setKeyboardFocus( nil ) if system.getInfo('platformName') == 'iPhone OS' then e.target.y = 590 end local inputText = e.target.text -- Validate if not validateChat( inputText ) then return false end -- OK!! SEND!!! M:send{ type='chat', msg=inputText } inputText = nil e.target.text = '' elseif e.phase == "editing" then -- NONE end end) self.ui.textField.align = 'left' self.ui.textField.size = 10 self.ui.textField.font = native.newFont( DEF\_FONT, 10 ) self.ui.textField.y = 590 --...