It is currently Wed May 22, 2013 11:42 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: PB 4.60B4 - LCase - Ucase bug with accented characters
PostPosted: Wed Aug 31, 2011 1:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Oct 22, 2003 2:51 am
Posts: 734
Location: Canada
Hello,

A little bug with LCase() and UCase() with accented characters.

Code:
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Project name : LCase - Ucase bug with accented characters
; File Name : LCase - Ucase bug with accented characters.pb
; File version: 1.0.0
; Programmation : OK
; Programmed by : Guimauve
; Date : 30-08-2011
; Last Update : 30-08-2011
; PureBasic code : 4.60 Beta 4 x64
; Plateform : Linux Mint 11 x64
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Debug "LCase(" + Chr(34) + "ÉÈÊ" + Chr(34) + ") = " + LCase("ÉÈÊ") + " --> This should return " + Chr(34) + "éêê" + Chr(34) + " instead of " + Chr(34) + "ÉÈÊ" + Chr(34)
Debug "UCase(" + Chr(34) + "éêê" + Chr(34) + ") = " + UCase("éêê") + " --> This should return " + Chr(34) + "ÉÈÊ" + Chr(34) + " instead of " + Chr(34) + "éêê" + Chr(34)

; <<<<<<<<<<<<<<<<<<<<<<<
; <<<<< END OF FILE <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<


Debugger output wrote:
LCase("ÉÈÊ") = ÉÈÊ --> This should return "éêê" instead of "ÉÈÊ"
UCase("éêê") = éêê --> This should return "ÉÈÊ" instead of "éêê"

Best regards.
Guimauve


Top
 Profile  
 
 Post subject: Re: PB 4.60B4 - LCase - Ucase bug with accented characters
PostPosted: Wed Aug 31, 2011 9:45 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 16, 2009 10:42 am
Posts: 531
Location: sweden
Mac OS Lion + 4.6b4 same result.
(funniest thing. I tried to do this do get a character i didnt have on my keyboard this morning and was just gonna post the same think... but i would probably have it under feature req instead of bug report).


Top
 Profile  
 
 Post subject: Re: PB 4.60B4 - LCase - Ucase bug with accented characters
PostPosted: Wed Aug 31, 2011 9:09 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Oct 22, 2003 2:51 am
Posts: 734
Location: Canada
jesperbrannmark wrote:
Mac OS Lion + 4.6b4 same result.


It's probably normal to have the same bug on different OS, the code behind LCase()/UCase() are very similar from one system to the next if it's not the same. Btw, how to submit a like this one when we know it will also occur on more than 1 OS.

I have a question, for example I have found a bug with LCase()/UCase() on Linux OS and I have reported it back in the Linux bug report forum. But jesperbrannmark report the same bug also occur on Mac OS. So should we post the same bug in the Mac OS bug report forum or the when we report a bug, the team take the time to verify if the problem occur for all system even if we have reported it in one of the three bug report forums ?

Best regards.
Guimauve


Top
 Profile  
 
 Post subject: Re: PB 4.60B4 - LCase - Ucase bug with accented characters
PostPosted: Thu Sep 01, 2011 7:38 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 16, 2009 10:42 am
Posts: 531
Location: sweden
Actually... just tried it in PB4.6b4+win7 and this is the result:

LCase("ÉÈÊ") = éèê --> This should return "éêê" instead of "ÉÈÊ"
UCase("éêê") = ÉÊÊ --> This should return "ÉÈÊ" instead of "éêê"

So this is just Mac+Linux and not Windows....


Top
 Profile  
 
 Post subject: Re: PB 4.60B4 - LCase - Ucase bug with accented characters
PostPosted: Tue May 22, 2012 9:21 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Oct 22, 2003 2:51 am
Posts: 734
Location: Canada
Hello everyone,

Sorry to re-up a bug topic but I have created a temporary patch for LCase() and UCase().

Code:
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Project name : LCase bug with accented characters
; File Name : LCase - Ucase bug with accented characters.pb
; File version: 1.1.0
; Programmation : Bug Demonstration
; Programmed by : Guimauve
; Date : 30-08-2011
; Last Update : 22-05-2012
; PureBasic code : 4.61 Final
; Plateform : Linux Mint 12 x64
; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Procedure.s LCase_Patch(String.s)

  For CharID = 1 To 27
    String = ReplaceString(String, Mid("ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ", CharID, 1), Mid("àáâãäåæçèéêëìíîïñòóôõöùúûüý", CharID, 1))
  Next
 
  ProcedureReturn LCase(String)
EndProcedure

Procedure.s UCase_Patch(String.s)
 
  For CharID = 1 To 27
    String = ReplaceString(String, Mid("àáâãäåæçèéêëìíîïñòóôõöùúûüý", CharID, 1), Mid("ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ", CharID, 1))
  Next
 
  ProcedureReturn UCase(String)
EndProcedure

Debug "LCase(" + Chr(34) + "ÉÈÊ" + Chr(34) + ") = " + LCase("ÉÈÊ") + " --> This should return " + Chr(34) + "éêê" + Chr(34) + " instead of " + Chr(34) + "ÉÈÊ" + Chr(34)
Debug "UCase(" + Chr(34) + "éêê" + Chr(34) + ") = " + UCase("éêê") + " --> This should return " + Chr(34) + "ÉÈÊ" + Chr(34) + " instead of " + Chr(34) + "éêê" + Chr(34)
Debug "LCase_Patch(" + Chr(34) + "ÉÈÊ" + Chr(34) + ") = " + LCase_Patch("ÉÈÊ")
Debug "UCase_Patch(" + Chr(34) + "éêê" + Chr(34) + ") = " + UCase_Patch("éêê")

; <<<<<<<<<<<<<<<<<<<<<<<
; <<<<< END OF FILE <<<<<
; <<<<<<<<<<<<<<<<<<<<<<<


Best regards.
Guimauve


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 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