chr(160) needs to be chr(49824) if cpinternal is utf-8

Project:DataDigger
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:duplicate
Description

Hello,

datadiggerlib.p and wdatadigger.w use chr(160), which is a non breaking space in ASCII, in their logic. This should be changed to a variable cNBSP:

DEFINE VARIABLE cNBSP AS CHARACTER  NO-UNDO.
IF SESSION:CPINTERNAL = "utf-8" THEN 
  ASSIGN cNBSP = chr(49824). 
ELSE 
  ASSIGN cNBSP = chr(160). 

Thanks,

Jan

ps.: The reason: chr(160) is invalid in utf-8, as a result the following code for prowin32 -cpinternal utf-8 :

MESSAGE REPLACE("a" + CHR(160) + "b", CHR(160), "~n")
  VIEW-AS ALERT-BOX INFO BUTTONS OK.

gives you this message:

---------------------------
Error
---------------------------
Second parameter of REPLACE must have non-zero length. (2918)
---------------------------
OK   
---------------------------

while this works (assuming cpinternal = utf-8):

MESSAGE REPLACE("a" + chr(49824) + "b", chr(49824), "~n")
  VIEW-AS ALERT-BOX INFO BUTTONS OK.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#1

Title:chr(160) needs to be chr(49824) if cpinternal is utf-8 » chr(160) needs to be chr(49824) if cpinternal is utf-8
Status:patch (code needs review)» duplicate

Nevermind, I see it was already reported, I looked at the open issues, but only saw support requests, not bug reports. Moreover it appears to be fixed in the beta for version 19.


#2

Nevermind, I see it was already reported, I looked at the open issues, but only saw support requests, not bug reports. Moreover it appears to be fixed in the beta for version 19.