Skip to content

Commit cc18b18

Browse files
committed
Document possible Unicode limitations
1 parent 31d3f78 commit cc18b18

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@ Golang pkg to convert any text input to camelCase, PascalCase or snake_case nami
77
## Usage
88
```go
99
import "github.com/golang-cz/textcase"
10-
```
1110

12-
```go
1311
textcase.CamelCase("Hello World!")
1412
// helloWorld
15-
```
1613

17-
```go
1814
textcase.PascalCase("Hello World!")
1915
// HelloWorld
20-
```
2116

22-
```go
2317
textcase.SnakeCase("Hello World!")
2418
// hello_world
2519
```
@@ -30,6 +24,14 @@ textcase.CamelCase("Háčky, čárky. Příliš žluťoučký kůň úpěl ďáb
3024
// háčkyČárkyPřílišŽluťoučkýKůňÚpělĎábelskéÓdy
3125
```
3226

27+
### Possible Unicode limitations
28+
```go
29+
textcase.CamelCase("Here comes O'Brian")
30+
// hereComesOBrian
31+
```
32+
33+
This package doesn't implement language-specific case mappers, such as [golang.org/x/text/cases](https://pkg.go.dev/golang.org/x/text/cases), and thus comes with a similar limitation to [strings.Title()](https://pkg.go.dev/strings#Title). But given the likely use cases of this package, we deliberately chose English version `hereComesOBrian` over `hereComesObrian` for the above `Here comes O'Brian` input.
34+
3335
# License
3436
Licensed under [MIT License](./LICENSE)
3537

0 commit comments

Comments
 (0)