← Back to team overview

kicad-developers team mailing list archive

Re: UTF8 source files

 

I checked the patch with GEdit, Vim, Geany, Notepad and HexEdit.
The original text shows as a mu sign ( in html μ )
changes the text into an A circumflex  ( in html  ) followed by
a mu sign.

In Hex it shows : 0xB5 0x6D changed into 0xC2 0xB5 0x6D ( where 0xC2
is the A circumflex)

my environment :  env | grep LANG
LANG=en_US.utf8
GDM_LANG=en_US.utf8

Is this as expected? Is something wrong with my setup?
http://www.utf8-chartable.de/

maybe encoding it as "\0xc2\0xb5" would be an option?

Greetings,
Edwin van den Oetelaar

2013/5/3 Dick Hollenbeck <dick@xxxxxxxxxxx>:
> We introduced a patch today which introduces UTF8 encoding into a couple of source files,
> then made a policy decision to allow UTF8 string constants in 8 bit strings.  So this is
> currently about 3 places only, nothing to worry about yet.
>
> The only time you can be sure you have an 8 bit string is if it is not wrapped in wxT().
>
> pcb_calculator uses some 8 bit strings.  In the future we will see more as wx 2.8 fades away.
>
> You should setup your programming editors to use UTF-8 encoding in the near future.
>
> After doing that, to check your editor, try loading the attached patch.  The "um" text in
> the patch should show the greek mu in the micron const string near UNIT_MICRON
>
>
>    http://en.wikipedia.org/wiki/Mu_%28letter%29
>
>
> We will be adding this to the coding standards document also.
>
> Note that ASCII files pass as UTF-8 files, but not vice versa.  So for a long time, and on
> most *.cpp files there will never be any difference.  Patches will still come in as ASCII,
> especially from new people.   Only when we have:
>
> a) in internationally recognized character, that is
> b) not ASCII, in a
> c) 8 bit string.
>
> will this ever be an issue moving forward.  And until wx 2.8 goes away, it is very limited
> in where we can *know* we have 8 bit strings, due to the wxT() wrapper in play in wx 2.8.
>  wxT() abstracts the bitness of the strings on different platforms and builds.
>
> Again, the test file is attached.
>
> Regards,
>
> Dick
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>


Follow ups

References