...

View Full Version : Language characters in string creating js errors



c1lonewolf
03-12-2012, 07:22 PM
Ok I changed a '.sql' file to .js to create a file for various languages, however when some some language chars. are placed in a string I mixed errors from my javascript function. Usually 'unterminated string' or 'Invalid procedure call or argument'.

all run through the same function call.

German




// sometimes this one works in a string without creating errors













spanish


















So any hints on how to actually use language characters? I've seen some javascripts that have language scripts that go with them and they don't seem to have any problems. Thanks for any help!

devnull69
03-12-2012, 11:45 PM
Best solution: Keep all of your stuff with the same character encoding. Usually I take utf-8 for this

1. in HTML set the meta tag for charset
2. in PHP files, set the header Content-type
3. most importantly: Make sure all of your source files are having the right character encoding (e.g. for Notepad++ set the encoding to "UTF-8 without BOM")

c1lonewolf
03-13-2012, 12:16 AM
Thanks devnull69 I'll try it!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum