Quantcast Special Character Problem - LoTROInterface
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 12-27-2013, 08:12 PM
Gimp Gimp is offline
The Undefeated
 
Join Date: May 2012
Posts: 7
Special Character Problem

I'm having a problem with special characters that maybe someone can help me with.

I'm hard coding a string in a table and trying to compare it to other strings I get from chat text. The problem I run into is when the string has special characters.

For instance, I have "Tham Mírdain" as one of my hard coded strings. If I print it to screen, it comes out as "Tham M?rdain". However, when I catch "Tham Mírdain" in my chat text, place it in a variable and print it to screen, it prints correctly. Comparing Tham M?rdain to Tham Mírdain isn't going to work.

Any ideas on why it is doing this and how to fix it?
Reply With Quote
  #2  
Unread 12-27-2013, 08:29 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 243
How are you hard coding the string? If you are simply typing "Tham Mírdain" into a text file and saving it, you may find that it will not be parsed by the Lua interpreter correctly. Some have had luck saving their source files with UTF-8 encoding. I prefer to force the string to it's expected value using the escaped byte values that make up the UTF character. In the case of "Tham Mírdain" it would be represented as "Tham M\195\173rdain" where the bytes 195 and 173 represent the "í" character. There is also a .lua file that defines the special characters available at http://www.lotrointerface.com/downlo...ingHelper.html if you prefer to go that way. As to comparing strings, I wrote a fairly simple mapping to strip special accents so that strings can be compared without the special characters so that users don't have to worry about entering the correct accents when searching for locations - check out the string.stripaccent function in MoorMap's main.lua file if you are interested.
Reply With Quote
  #3  
Unread 12-30-2013, 08:20 PM
Gimp Gimp is offline
The Undefeated
 
Join Date: May 2012
Posts: 7
I tried encoding it in UTF8 but lotro gave me errors when I tried loading the file. I went with using the UTF helper by Ooz, which seems to work for me.

Thanks for telling me about it. I searched the forums, but I wasn't using the right search terms it seems
Reply With Quote
  #4  
Unread 12-30-2013, 10:33 PM
Thurallor's Avatar
Thurallor Thurallor is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: May 2013
Posts: 136
I use Notepad++ and save the file in "UTF without BOM" encoding. Works for me.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with character panel jaycemanus Interface Help (L) 1 02-10-2012 07:15 PM
Character Panel OrION Interface Help (L) 2 03-22-2011 09:26 AM
Missing special effects for legendary weapons Justin12221 Chit Chat 3 02-04-2011 06:04 PM
EU client and translations/special characters Pengoros Lua Programming Help (L) 0 12-08-2010 11:20 AM
Character UI Placement File? fwaits General Authoring Discussion (L) 2 05-06-2007 09:05 PM


All times are GMT -5. The time now is 11:00 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui