.NET uses UTF-16 as its internal representation of strings, which handle
non-ASCII characters perfectly. XML (and HTML nowadays) default to UTF-8
and if non-ASCII characters show up as two characters, that means
somewhere along the pipeline those (two-byte) UTF-8 characters has been
mis-interpreted as (one-byte) ASCII/ISO-8859-1/Windows-1252 characters.
It might also be the other way around; that ISO-8859-1 or Windows-1252
characters (which are stored as one byte) are read as UTF-8 and because
one of the two bytes that comprises non-ASCII characters (well, in most
cases) are missing, will be represented as a question mark or other
"unknown character" replacement.
Either way, this is an character codec problem that needs to be fixed at
the codec level instead of hacking around the problem with HTML entity
replacements.
I would first look at the way the .spark files are stored on disk. Are
they stored as UTF-8 or as Windows-1252/ISO-8859-X? Make sure they are
stored as UTF-8 and open them in another editor to ensure that the
characters are represented correctly.
If the .spark files are encoded correctly, how does the rest of the
pipeline look like? What editor do you use to create the views? Does the
Norwegian characters come from a database? From other files read from the
file system? Somewhere else? Does the output encoding of the web
application match the encoding of the characters being transmitted to the
browser? Does the browser know how to decode the given encoding? Does all
browsers yield the same result?
If nothing at all yields any constructive results, then I can recommend
falling back to HTML entities, but that should be an absolute last resort,
because it will only get rid of the problem like whack-a-mole gets rid of
the mole; it is guaranteed to pop up again in a different location.
-Asbjørn
Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
> To post to this group, send email to spar...@googlegroups.com.
> To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.
>
-Asbjørn