It is currently Fri Jun 22, 2018 6:41 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: FastCGI wrong encoding for parameter values
PostPosted: Sun Jan 21, 2018 7:00 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Aug 15, 2009 6:59 pm
Posts: 1243
CGIParameterValue returnes a ASCII encoded string. While the Apache module is providing a UTF-8 encoded string. So all none ASCII characters are two wrong characters in the returned string.

I use this workaround for now, but it's kind of ugly and i would appreciate a fix for it.

Code:
UserName = CGIParameterValue("username")
If UserName <> ""
  TextTranscodeBuffer = Ascii(UserName)
  UserName = PeekS(TextTranscodeBuffer, -1, #PB_UTF8)
  FreeMemory(TextTranscodeBuffer)
EndIf

This will write the string as ASCII to memory, so it gets written byte by byte as it came from the FastCGI module. Then it will read it back as UTF-8 and the characters are fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye