You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Michael Franklin <sl...@yahoo.com> on 2009/08/13 15:47:31 UTC

Hello World Module in UTF-8

Hello,

I would like to modify the typical Hello World module to output in UTF-8 and say "Hello" in a different language.  For example 안녕 in Korean.  I'm using Visual Studio 2008 Express on Windows XP, but would like my module to also compile and run in Linux.

I intend to use wchar_t or std::wstring internally to manage text, but output UTF-8 to the client.  I have tried using the apr_xlate api, but apr_xlate_open() always returns APR_EINVAL despite what I pass for the to and from character encodings.  And I'm not even sure if using the apr_xlate api is the right approach.

I've search all over the web for help.  I've learned a great deal in the process, but haven't found anything directly related to my goal, which has me questioning my overall approach.  Yes I'm a newbie to Apache development, hence the Hello World related question.

Thanks in advance for any help,
Mike



      

Re: Hello World Module in UTF-8

Posted by Michael Franklin <sl...@yahoo.com>.
So my questions are:  

1)  In an Apache module, how do you output a std::wstring or wchar_t* to the client as UTF-8?  

2)  Does APR have an API designed specifically for this purpose?




----- Original Message ----
To: modules-dev@httpd.apache.org
Sent: Thursday, August 13, 2009 10:47:31 PM
Subject: Hello World Module in UTF-8

Hello,

I would like to modify the typical Hello World module to output in UTF-8 and say "Hello" in a different language.  For example 안녕 in Korean.  I'm using Visual Studio 2008 Express on Windows XP, but would like my module to also compile and run in Linux.

I intend to use wchar_t or std::wstring internally to manage text, but output UTF-8 to the client.  I have tried using the apr_xlate api, but apr_xlate_open() always returns APR_EINVAL despite what I pass for the to and from character encodings.  And I'm not even sure if using the apr_xlate api is the right approach.

I've search all over the web for help.  I've learned a great deal in the process, but haven't found anything directly related to my goal, which has me questioning my overall approach.  Yes I'm a newbie to Apache development, hence the Hello World related question.

Thanks in advance for any help,
Mike