WoW:Localizing an addon: Difference between revisions

Line 138: Line 138:
== Unicode ==
== Unicode ==


WOW can recognize unicode charactor IF .lua file is saved in unicode format.
WOW can recognize unicode characters directly in any .lua file, if this file is saved in unicode format. The exact format to use is "utf-8".


In order to edit any text file in utf-8, you need a text editor which supports utf-8. By default, the normal encoding for text files is usually iso8859-1. Some older editors might use the ANSI character set instead though.


 
My preference in text file editing goes to [[http://www.editpadpro.com/editpadlite.html|EditPad Lite]]. By default, it edits using the ANSI charset, but it can convert the whole buffer to UTF-8 using the Convert/Unicode/ANSI->UTF-8 function. There are of course lots of other commercial softwares around which are able to save files in UTF-8 encoding.
Check .lua file format:
 
The first two bytes of unicode file is "FF FE".
 
Open .lua file with UltraEdit(My favorite binary editor in windows). Change to binary mode (Use Ctrl-H or use menu Edit->Hex Edit). It should be "FF FE" at the beginning of the file if it is a unicode file, and almost every second byte is "00"
 
 
 
 
Save file in unicode format:
 
Open notepad, then open your file. Click File->Save As...
 
Select Unicode Encoding At the bottom of popup windows.
 
Put it anythere you want.


== The single quote case ==
== The single quote case ==
Anonymous user