Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: copyright symbol Date: Wed, 04 Jun 2014 11:06:31 +0200 Organization: PointedEars Software (PES) Lines: 63 Message-ID: <2339146.HsSRG6Ygpm@PointedEars.de> References: Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1401872807 5797 eJwVxsERACEIA8CWVEjwyiEo/Zfg3L4WxskKJ+hoNG2rx+4bNYvpuKJPQ+go0BX11dLI1PmzHikyEes= (4 Jun 2014 09:06:47 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 4 Jun 2014 09:06:47 +0000 (UTC) User-Agent: KNode/4.12.4 X-User-ID: eJwNyMERACAIA7CVEAHrOBZw/xH08ovPGJHLwsP8foC3okahzzZN+yUY9HWrWg+dohO8krazOrgYXVpQpfgDWkMV+A== Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. I have an MS SQL Server database with a copyright symbol in a field of > data type varchar(80). When this is read by JScript in a classic ASP and > then displayed in the page the symbol displays as a black diamond with a > question mark in it. That is a possible rendering of U+FFFD REPLACEMENT CHARACTER. It is used here because the code sequence leading to the character in the database (A9) is not a proper UTF-8 code sequence (A9 is reserved as continuation byte). > If I change the page's charset from > > to > > the symbol correctly displays as a copyright symbol. > > Why does changing the charset "fix" the display of the symbol? > > I'd rather keep the charset as UTF but I'm at a loss as to what's going > on. The term “charset” is historical and misleading. This “meta” element specifies the character *encoding* of the resource unless there is an HTTP “Content-Type” header field value that takes precedence. This client-side change has an effect, so you are not serving a “Content-Type” header field value with a ”charset” parameter; your server-side code is incomplete or in error. UTF-8 is the Unicode encoding that uses 8 bits per code unit. A Unicode character, precisely its code point, can be encoded with up to four such code units. > Do I need to change the data type? No. > Do I need to encode the symbol before it goes into the database? No, but it would be a good idea. > Do I need to unescape/decode the value from the database? Yes, you need to *re*code string values if the database uses a different character encoding than the document resource you are generating. This problem has very little to do with ECMAScript implementations. Next time, do research. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not Cc: me. / Bitte keine Kopien per E-Mail.