transform "@S" in UTF8 BUG

97 views
Skip to first unread message

Marek Długosz

unread,
Aug 14, 2025, 6:55:15 AMAug 14
to harbou...@googlegroups.com
Hi!

I have found a bug in transform with "@Sxx" template 

hb_cdpselect('UTF8EX')
? transform('śńć','@S3') -> ś♣   

Regards

Marek



mdlugosz65@gmail.com.asc

Hurricane

unread,
Aug 14, 2025, 11:40:25 AMAug 14
to Harbour Users, harbou...@googlegroups.com
Hi,
There's probably no bug, you just need to perform conversions correctly.
There's a cost to using CP/Char. It can be simple, confusing, complex or *dangerous.

* With careless use, corrupt index without realizing, without message. 


// Hurricane
REQUEST HB_CODEPAGE_UTF8EX

FUNCTION MAIN
   LOCAL cCP, cVal
   
   cVal:='śńć'
   for each cCP in { nil, 'UTF8EX' }
      ? '------------------------'
      hb_cdpselect(cCP)
      ? 'CP', hb_cdpselect()
      ? LEN(cVal)
      ? hb_utf8Len(cVal)
      ? transform(cVal,'@S3')
      ? transform(cVal,'@S6')
     
   NEXT
   RETURN NIL



Note:
I suggest using the Harbour Users group, it is easy to confuse incorrect use with bug.
The Harbour Developers group is constantly being used incorrectly: support, useless matters/polls, even to complain about Harbour, with an example of purposely wrong and meaningless syntax, syntaxes of other languages...

Regards,
Hurricane

Marek Długosz

unread,
Aug 15, 2025, 9:30:25 AMAug 15
to harbou...@googlegroups.com
It should behave exactly the same

? transform('śńć','@S3') -> ś♣   
? transform('śńć','XXX') -> 'śńć'

Marek
------ Wiadomość oryginalna ------
Nadawca "'Hurricane' via Harbour Developers" <harbou...@googlegroups.com>
Do "Harbour Users" <harbou...@googlegroups.com>
Data 14.08.2025 16:53:05
Temat [harbour] Re: transform "@S" in UTF8 BUG
--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/46116695.5479401.1755183185400%40mail.yahoo.com.
mdlugosz65@gmail.com.asc
Reply all
Reply to author
Forward
0 new messages