IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PureBasic Discussion :

Débat : Faut-il supprimer le switch ASCII dans l'IDE de PureBasic ?


Sujet :

PureBasic

  1. #1
    Responsable Purebasic

    Avatar de comtois
    Inscrit en
    Avril 2003
    Messages
    1 259
    Détails du profil
    Informations forums :
    Inscription : Avril 2003
    Messages : 1 259
    Points : 9 811
    Points
    9 811
    Billets dans le blog
    8
    Par défaut Débat : Faut-il supprimer le switch ASCII dans l'IDE de PureBasic ?
    L'équipe PureBasic lance un débat, faut-il supprimer le mode ASCII ? Vous pouvez participer au débat sur le forum officiel de PureBasic, votre avis est important.

    Hi there,

    Since PB 5.30, the minimum Windows OS to run PureBasic is Windows XP. That means than every OS (Windows XP+, OS X 10.5+, Linux) now supports unicode natively, so we discussed with Timo the opportunity for us to remove ASCII support from PB and provide an unicode only compiler. Still supporting ASCII is a big work for us, as we need to provide duplicate fonctions when dealing with strings, which can leads to more bugs. Also, ASCII is an old tech and is condamned to disappear sooner or later, as unicode can handle it as well.

    What would change for you:

    - Basically, if your software runs with the "unicode" swith ON, nothing will change, you can skip the following text . If not, then you can enable it and test it.
    - All strings in PB will be handled as UCS2 (16-bit) strings internally. So if you used "@String$" somewhere in your code, change are high it won't work anymore (if dealing which an API for example)
    - We plan to provide 2 new functions, to ease things a bit:
    *AsciiBuffer = ToAscii(String$)
    *UTF8Buffer = ToUTF8(String$)

    What would change for us:

    - Faster building time, less code in our source tree, makefiles much shorter
    - Less bugs because of code reduction
    - No more unicode switch, so it's easier when sharing code source on the forum, or when developping an user lib (everybody is unicode)
    - Makes PB definitely more modern.

    We would like to do it for the 5.40 version. What are your thoughts about it ? Is it a deal breaker for you ?

    edit: before freaking out, we are just talking about removing the "unicode switch", not all ascii related operations !

    The Fantaisie Software Team
    Vous souhaitez participer à la rubrique PureBasic (tutoriels, FAQ, sources) ? Contactez-moi par MP.

  2. #2
    Responsable Purebasic

    Avatar de comtois
    Inscrit en
    Avril 2003
    Messages
    1 259
    Détails du profil
    Informations forums :
    Inscription : Avril 2003
    Messages : 1 259
    Points : 9 811
    Points
    9 811
    Billets dans le blog
    8
    Par défaut
    le débat est clos. L'équipe PureBasic a décidé de ne plus maintenir le switch ASCII d'ici 3 ans pour la version LTS, et d'ici un an pour la version non LTS.

    Hello everybody,

    As Fred has explained here, supporting both the creation of ascii and unicode executables in the compiler is becoming a burden and we would like to end support for ascii compilation in order to streamline the library code and make it easier to maintain the PureBasic package in the future. However, the above thread has shown that people wish for a longer transition period, and we would like to honor this wish.

    So we decided to remove the ability to compile in ascii mode in the PB version that follows after the next LTS version (that is, the LTS version coming after the 5.2x LTS cycle ends).

    There are no exact dates for the releases, but the timeline looks like this:

    • The current 5.2x LTS version will be supported until at least 09/17/2015
    • After that date, a new LTS version will be released with support for 2 years. This version will still have full ascii compilation support.
    • The first non-LTS version released after the next LTS cycle starts will have no ascii compilation support



    This means that the first non-LTS version without ascii support will be released in about a year. By staying with LTS releases, you have the ability to use an ascii mode compiler with a fully supported PB version for at least another 3 years starting from today. This should give enough time for a smooth transition.

    No changes will be made to the language or data types (The .c, .a and .u as well as the pseudo-types and library commands will remain as they are). The only difference is that the "compile in unicode mode" switch in the compiler will be permanently set to "on".

    Please understand that we do listen to the concerns voiced in the discussion thread and that we do not make this decision lightly. I think we have a quite good track record of supporting older technology as is evidenced by the very long support for Windows 9x which just recently ended and by the fact that we still support Windows XP even after MS dropped all support for it. However, in order for us to be able to introduce new technologies (like x64 compilation in the past, or now support for the web with Spiderbasic), we simply cannot support old stuff indefinitely. In order to move forward into the future, we have to leave some stuff behind from time to time. We hope you can understand that.

    The PureBasic Team
    Source de l'information
    Vous souhaitez participer à la rubrique PureBasic (tutoriels, FAQ, sources) ? Contactez-moi par MP.

  3. #3
    Responsable Purebasic

    Avatar de comtois
    Inscrit en
    Avril 2003
    Messages
    1 259
    Détails du profil
    Informations forums :
    Inscription : Avril 2003
    Messages : 1 259
    Points : 9 811
    Points
    9 811
    Billets dans le blog
    8
    Par défaut
    Danilo nous a concocté un résumé des fonctions permettant d'utiliser l'ASCII bien que le programme soit compilé en UNICODE.

    The ability to work with data buffers is still there, for input and output. Memory buffers can contain
    any data you want, including Byte data and Ascii characters
    .


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    Structure AsciiArr : a.a[0] : EndStructure
     
    Length = 1024
    *Buffer.Ascii = AllocateMemory(Length)
     
    *pointer.AsciiArr = *buffer
    If *pointer
        *pointer\a[0] = 'A'
        *pointer\a[1] = 'B'
        *pointer\a[2] = 'C'
     
        Debug PeekS(*pointer, -1, #PB_Ascii)
     
        PokeS(*pointer, "Hello World", -1, #PB_Ascii)
     
        For i = 0 To 12
            Debug " Dec: " + *pointer\a[i] +
                  " Hex: " + Hex( *pointer\a[i] ) +
                  " Chr: " + Chr( *pointer\a[i] )
        Next
    EndIf
     
    CompilerIf 0
     
    ;--------------------------------------------------------------------------------------------------------------
    ;  Data functions                                      ;  String functions
    ;--------------------------------------------------------------------------------------------------------------
    ;                                                      ;
    ;                                                      ;
    ; Serial Port                                          ;
    ;                                                      ;
    WriteSerialPortData(#SerialPort, *Buffer, Length)      ; WriteSerialPortString(#SerialPort, String$ [, Format])
    ReadSerialPortData (#SerialPort, *Buffer, Length)      ;
    ;--------------------------------------------------------------------------------------------------------------
    ;                                                      ;
    ;                                                      ;
    ; Process                                              ;
    ;                                                      ;
    WriteProgramData(Program, *Buffer, Length)             ; PB 5.2x: WriteProgramString (Program, String$)   --  optional [, Format] missing (use data functions)
                                                           ;          WriteProgramStringN(Program, String$)   --  optional [, Format] missing (use data functions)
                                                           ; PB 5.3+: WriteProgramString (Program, String$ [, Flags])
                                                           ;          WriteProgramStringN(Program, String$ [, Flags])
                                                           ;                                                       
    ReadProgramData (Program, *Buffer, Length)             ; PB 5.2x: ReadProgramString(Program)             --  optional [, Format] missing (use data functions)
                                                           ; PB 5.3+: ReadProgramString(Program [, Flags])
    ;--------------------------------------------------------------------------------------------------------------
    ;                                                      ;
    ; Network                                              ;
    ;                                                      ;
    SendNetworkData   (Connection, *Buffer, Length)        ; SendNetworkString(Connection, String$ [, Format])
    ReceiveNetworkData(Connection, *Buffer, Length)        ;
    ;--------------------------------------------------------------------------------------------------------------
    ;                                                      ;
    ; File                                                 ;
    ;                                                      ;
    WriteData(#File, *Buffer, Length)                      ; WriteString (#File, Text$ [, Format])
                                                           ; WriteStringN(#File, Text$ [, Format])
    ReadData (#File, *Buffer, Length)                      ; ReadString  (#File [, Flags [, Length]])
    ;--------------------------------------------------------------------------------------------------------------
    ;                                                      ;
    ; Console                                              ;
    ;                                                      ;
    WriteConsoleData(*Buffer, Length)                      ; Print (Text$)                          --  optional [, Format] missing (use data functions)
                                                           ; PrintN(Text$)                          --  optional [, Format] missing (use data functions)
    ReadConsoleData (*Buffer, Length)                      ; String$ = Input()                      --  optional [, Format] missing (use data functions)
    ;--------------------------------------------------------------------------------------------------------------
     
    CompilerEndIf
    Vous souhaitez participer à la rubrique PureBasic (tutoriels, FAQ, sources) ? Contactez-moi par MP.

Discussions similaires

  1. Signification de codes ASCII dans OnKeyPress
    Par e-ric dans le forum Langage
    Réponses: 5
    Dernier message: 19/08/2005, 11h33
  2. Réponses: 17
    Dernier message: 12/04/2005, 16h28
  3. Import fichier ASCII dans une base
    Par pithier dans le forum Bases de données
    Réponses: 3
    Dernier message: 01/02/2005, 20h03
  4. supprimer un enregistrement vide dans une table oracle
    Par shurized dans le forum Bases de données
    Réponses: 11
    Dernier message: 07/09/2004, 17h55
  5. Réponses: 2
    Dernier message: 12/01/2004, 14h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo