philihp.com

Tag: Unicode

SAS Encoding Libname Option

So my coworker was having a problem where he was reading a dataset that he did not own. It was a SAS9 dataset encoded in UTF-8, and contained ™ (U+2122), the trade mark sign. His SAS session was running a local encoding of latin1, ISO_8859-1, which did not have it. My instinct says, it should [...]

Changing a SAS Dataset’s Encoding

In SAS9, every dataset should have an “encoding” property that specifies the charset of the bytes in its character variables. You can manually set this without having SAS try to transcode it into a new encoding by using a proc datasets modify. data work.src(encoding=’any’); length s $20; s = ’6E756C6C’x; output; s = ‘C3B1C3BC6C6C’x; output; [...]

Content-type for XML files

When reporting the Content-Type of an XML document (such as in the HTTP response headers) use “application/xml”, rather than “text/xml”. The reason for this is because the first line of your XML document should tell the client what the encoding of the document is anyway. <?xml version=”1.0″ encoding=”charset”?> If you were to use text/xml, you’d [...]