Forum OpenACS Development: Re: Charset difference with NaviServer and OpenACS 5.9:

Thank you Gustaf, we are in agreement. My reply was meant to put more emphasis on the function of ns_startcontent (as opposed to the response headers) as it sets the connection outputEncoding and if that is not set to utf-8 (the default for outputCharset parameter) naviserver converts the actual response (via Tcl_UtfToExternalDString) before it is sent back to the browser. Converting a utf-8 string to external, converts each byte of a utf-8 character thus leading to the awkward result. Finally, I suggest checking the data in the db before delving deeper into encodings.
ns_startcontent is deprecated since 2007 (see [1] for the discussion). -g

[1] https://sourceforge.net/p/naviserver/mailman/message/8350950/

Hi!

Thanks for the quick replies first of all.

I spent a few hours producing sample code and unsuccessfully trying to understand character encoding in AOL/NaviServer. Until I found out that I simply have to replace ns_startcontent with ReturnHeaders. Sorry, this didn't become clear from your discussion.

- Maybe you want to update the documentation of ns_headers. It does't say anything about "configuring the streams", which it should. I understood it's just a variant of ns_write.
- Why did't you update ns_startcontent to behave consistently in NaviServer?

Even following the SF discussion on ns_headers I don't understand why you had to break something, even if it is "old" or "inconsistent".

This is all handled automatically now, and ns_startcontent should not be used.

Breaking stuff means increased costs for us (and others) to update. If you break stuff, then we'll need to fall back to the policy to update only if absolutely necessary. The last time we managed to stay 7 years in that mode...

Cheers,
Frank

It would have taken me much less time digging around in po code if you would have submitted a proper minimal bug report.
I have provided you with simple functions showing how streaming pages are supposed to work, using these should be quite straightforward for an experienced developer.

The function "ns_startcontent" was deprecated in NaviServer about 9 years ago, so i am not impressed by the the 7 years your code worked for aolserver :). The function was probably at no time working in NaviServer exactly as in aolserver (my guess is that the differences might be related with the various strange charset options in aolserver which are gone in NaviServer). It would have been probably better to remove the function in NaviServer 10 years ago, so the difference would have popped up sooner.

Anyhow, the right way for OpenACS applications is to use the abstractions provided by OpenACS and not using the low-level functions. These were introduced 15 years ago not without reason.

all the best
-g

https://openacs.org/forums/message-view?message_id=27658

Thanks a lot!!

Frank