Skip to content

The accented characters in strings are automatically uppercased #5732

@vicuna

Description

@vicuna

Original bug ID: 5732
Reporter: Ted
Assigned to: @protz
Status: closed (set by @xavierleroy on 2016-12-07T10:37:03Z)
Resolution: not a bug
Priority: normal
Severity: minor
Platform: Laptop
OS: Debian Unstable
OS Version: 3.2.0-3-amd64
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)
Child of: #6694

Bug description

(I have reproduced this bug to 3.10 version of OCaml too)

A little example is worth a long speech :

$ ocaml
Objective Caml version 3.12.1

"Ô, mon brûlant zéphyr doré";;

  • : string = "\195\148, mon br\195\187lant z\195\169phyr dor\195\169"

String.lowercase "Ô, mon brûlant zéphyr doré";;

  • : string = "\227\148, mon br\227\187lant z\227\169phyr dor\227\169"

String.uppercase "Ô, mon brûlant zéphyr doré";;

  • : string = "\195\148, MON BR\195\187LANT Z\195\169PHYR DOR\195\169"

I don't know if the encoding problem is normal, but I am pretty sure that this behaviour is not : String.uppercase does nothing, which means that the system automatically transforms the letter "é" into "É", etc. This bug is present for many accented letters :

String.uppercase "éèàâôû?ãõëäöÿçùò?" = "éèàâôû?ãõëäöÿçùò?";;

  • : bool = true

but, quite surprisingly, not for every one of them :

String.uppercase "?" = "?";;

  • : bool = false

String.uppercase "?" = "?";;

  • : bool = false

This problem happens even when I do not use my usual alias (ocaml="rlwrap ocaml") or my usual shell (zsh), and this bug occurs too when compiling ocaml code with ocamlc or ocamlopt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions