Jorge Olguin (super carnicerias hernandez sa de cv) asked a question.

What is the safest way to change the page encoding to UTF-8 without causing any issues?

I'm relying heavily on Claude to document source code, but it consumes considerable resources to verify that each file is correctly interpreted according to its codepage. It then proceeds to document and revert the codegape back to ISO-8859.

Is there a safe and consequence-free way to change the page encoding of all source (more than 4500 files) to UTF-8? Could PDSOE be at risk in this process?

The database is also defined as ISO-8859. Since I plan to perform a dump and reload in August to migrate from Workgroup to Enterprise, perhaps this would be a good time to consider switching to UTF-8.

 

Any advice will be very appreciated.

 

TIA

Jorge


  • Mike Fechner (Consultingwerk)

    Or as he's already using Claude, just ask Claude to generate a Python/Powershell/Bash/ABL/... script to convert all files in the folder from ISO8859-1 to UTF-8

     

    PDSOE a risk in that process? (I'll refrain from making any inappropriate comments about PDSOE here)

     

    Make sure the Project AVM's -cpstream startup parameter is set to UTF-8 (that is used to read the source code) and also the projects or workspaces code page setting is set to UTF-8 as well. But cpstream changes the default I/O codepage, also for your application runtime. That might be something you should test very carefully.

     

    If you're using the OpenEdge Character client, be aware of it's limited support for UTF-8. https://community.progress.com/s/article/000046818

     

    Our codebase is also still ISO8859-1 and has some German Umlaute (mostly in last names in developer comments) in the source. All my code changes are done by Claude - so what issue are you running into? It might be easier to solve that issue than migrating your application to UTF-8 over night.

    Selected as Best
  • Jorge Olguin (super carnicerias hernandez sa de cv)

    I forgot to mention, I'm confident to upgrade from 11.7 all the way up to 13.... what do you think?

  • Matt Baker (Progress Software)

    Don't waste AI credits/tokens on this type of thing. Just use existing unix functionality. (I'm sure you can do this with powershell too).

     

     

     

    1. #!/bin/bash
    2.  
    3. # Target directory (defaults to current directory if not specified)
    4. TARGET_DIR="${1:-.}"
    5.  
    6. # Find and process all files in the directory
    7. find "$TARGET_DIR" -type f | while read -r file; do
    8. # Create a temporary file name
    9. temp_file=$(mktemp)
    10. # Convert encoding from ISO-8859-1 to UTF-8
    11. if iconv -f ISO-8859-1 -t UTF-8 "$file" > "$temp_file" 2>/dev/null; then
    12. # Replace the original file with the converted version
    13. mv "$temp_file" "$file"
    14. echo "Converted: $file"
    15. else
    16. # Clean up the temp file if conversion failed
    17. rm -f "$temp_file"
    18. echo "Failed or skipped: $file"
    19. fi
    20. done

     

     

  • Mike Fechner (Consultingwerk)

    Or as he's already using Claude, just ask Claude to generate a Python/Powershell/Bash/ABL/... script to convert all files in the folder from ISO8859-1 to UTF-8

     

    PDSOE a risk in that process? (I'll refrain from making any inappropriate comments about PDSOE here)

     

    Make sure the Project AVM's -cpstream startup parameter is set to UTF-8 (that is used to read the source code) and also the projects or workspaces code page setting is set to UTF-8 as well. But cpstream changes the default I/O codepage, also for your application runtime. That might be something you should test very carefully.

     

    If you're using the OpenEdge Character client, be aware of it's limited support for UTF-8. https://community.progress.com/s/article/000046818

     

    Our codebase is also still ISO8859-1 and has some German Umlaute (mostly in last names in developer comments) in the source. All my code changes are done by Claude - so what issue are you running into? It might be easier to solve that issue than migrating your application to UTF-8 over night.

    Selected as Best
  • Jorge Olguin (super carnicerias hernandez sa de cv)

    Thanks! Perhaps I should stay as we are now, with ISO8859-1.

    So no more worrying about pagecode, for time being.

     

    @Mike Fechner (Consultingwerk)​  You mentioned about pdsoe, so wait some post to learn about that. (I've read lots of comments on VS)

     

    Thanks

    Jorge Olguín (jaja please please note the accent, that's my last-name)