Branch: Tag:

2008-11-05

2008-11-05 10:27:28 by Stefan Wallström <stewa@roxen.com>

Added encodings utf16 = utf16be, utf16le and hex.

Rev: server/etc/modules/Roxen.pmod:1.250

1:   // This is a roxen pike module. Copyright © 1999 - 2004, Roxen IS.   // - // $Id: Roxen.pmod,v 1.249 2008/10/12 22:14:03 mast Exp $ + // $Id: Roxen.pmod,v 1.250 2008/11/05 10:27:28 stewa Exp $      #include <roxen.h>   #include <config.h>
2319:    case "utf-8":    return string_to_utf8(val);    +  case "utf16": +  case "utf16be": +  return Locale.Charset.encoder("utf16be")->feed(val)->drain(); +  +  case "utf16le": +  return Locale.Charset.encoder("utf16le")->feed(val)->drain(); +  +  case "hex": +  if(String.width(val) > 8) +  RXML.run_error( "Cannot hex encode wide characters.\n" ); +  return sprintf("%{%02x%}",map(val/1,`[],0)); +     case "base64":    case "base-64":    case "b64":