The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for December, 2018

UTF-8 support for single byte character sets is beta in Windows and likely breaks a lot of applications not expecting this (via Unicode in Microsoft Windows: UTF-8 – Wikipedia)

Posted by jpluimers on 2018/12/04

Uh-oh: [WayBack] Unicode in Microsoft Windows: UTF-8 – Wikipedia:

Microsoft Windows has a code page designated for UTF-8code page 65001. Prior to Windows 10 insider build 17035 (November 2017),[7] it was impossible to set the locale code page to 65001, leaving this code page only available for:

  • Explicit conversion functions such as MultiByteToWideChar
  • The Win32 console command chcp 65001 to translate stdin/out between UTF-8 and UTF-16.

This means that “narrow” functions, in particular fopen, cannot be called with UTF-8 strings, and in fact there is no way to open all possible files using fopen no matter what the locale is set to and/or what bytes are put in the string, as none of the available locales can produce all possible UTF-16 characters.

On all modern non-Windows platforms, the string passed to fopen is effectively UTF-8. This produces an incompatibility between other platforms and Windows. The normal work-around is to add Windows-specific code to convert UTF-8 to UTF-16 using MultiByteToWideChar and call the “wide” function.[8] Conversion is also needed even for Windows-specific api such as SetWindowText since many applications inherently have to use UTF-8 due to its use in file formats, internet protocols, and its ability to interoperate with raw arrays of bytes.

There were proposals to add new API to portable libraries such as Boost to do the necessary conversion, by adding new functions for opening and renaming files. These functions would pass filenames through unchanged on Unix, but translate them to UTF-16 on Windows.[9] This would allow code to be “portable”, but required just as many code changes as calling the wide functions.

With insider build 17035 and the April 2018 update (nominal build 17134) for Windows 10, a “Beta: Use Unicode UTF-8 for worldwide language support” checkbox appeared for setting the locale code page to UTF-8.[a] This allows for calling “narrow” functions, including fopen and SetWindowTextA, with UTF-8 strings. Microsoft claims this option might break some functions (a possible example is _mbsrev[10]) as they were written to assume multibyte encodings used no more than 2 bytes per character, thus until now code pages with more bytes such as GB 18030 (cp54936) and UTF-8 could not be set as the locale.[11]


  1. Jump up^ [WayBack“UTF-8 in Windows”Stack Overflow. Retrieved July 1, 2011.
  2. Jump up^ [WayBack“Boost.Nowide”.
  3. Jump up^ [WayBackhttps://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strrev-wcsrev-mbsrev-mbsrev-l
  4. Jump up^ [WayBack“Code Page Identifiers (Windows)”msdn.microsoft.com.

Via [WayBack] Microsoft Windows Beta UTF-8 support for Ansi API could break things. Wiki Article of the Change… – Tommi Prami – Google+

Related, as handling encoding is hard, especially if it is changed or not your default:

–jeroen

Posted in .NET, C, C++, Delphi, Development, Encoding, GB 18030, Power User, Software Development, UTF-16, UTF-32, UTF-8, UTF16, UTF32, UTF8, Windows, Windows 10 | 2 Comments »

Getting rid of trailing line-endings in the draw.io web interface

Posted by jpluimers on 2018/12/03

One of the things that bugged me for a long time is that every now and then for some shapes, when editing their text, the draw.io web interface puts in trailing line feeds after the text, messing up layout.

The easiest way to work around it is by searching inside the diagram XML for
"
, then replacing that with a ".

(the above code got screwed by WordPress.com saving it, so the search is in this small gist below)

This behaviour is intermittent on the drawio MacOS desktop app.



"

–jeroen

 

Posted in Cloud Apps, Development, draw.io, Encoding, Internet, Power User, Software Development, Unicode | Leave a Comment »

How to configure pfSense as multi wan (DUAL WAN) load balance failover router – nixCraft

Posted by jpluimers on 2018/12/03

This will come in useful one day:

Notes for monitoring at [WayBackMulti-WAN – PFSenseDocs: Gateway Groups

  • monitoring packet loss on ADSL is cumbersome depending on the ADSL distance
  • member down is the easiest to monitor, but on fiber can fail to detect packet loss (the connection seems online, but in fact doesn’t provide traffic)

–jeroen

Posted in Internet, pfSense, Power User, routers | Leave a Comment »

8 Linux Commands: To Find Out Wireless Network Speed, Signal Strength And Other Information – nixCraft

Posted by jpluimers on 2018/12/03

[WayBack8 Linux Commands: To Find Out Wireless Network Speed, Signal Strength And Other Information – nixCraft:

Explains various Linux tools and command that can be used to monitor application for wireless network devices. These tools can display wireless single strength (levels), frequencies, speed and much more.

That will prove to be useful one day.

–jeroen

via:

[WayBack] Want to monitor a wireless network on Linux? Try these eight tools. – nixCraft – Google+

Read the rest of this entry »

Posted in *nix, *nix-tools, Power User | Leave a Comment »

Printing WordPress receipts in Chrome resulting in strangely accented text turned out to be a Chrome issue

Posted by jpluimers on 2018/12/02

This appeared to be a Chrome thing: [WayBack] Jeroen Pluimers at Twitter: “@wordpressdotcom not sure what goes wrong with billing, but the printed html has odd domain characters. The viewed HTML is OK, but I cannot print that because printing garbles it. I can DM you the receipt links. Similar for the date which becomes unreadable (the IRS dislikes it).…”

–jeroen
Read the rest of this entry »

Posted in Chrome, LifeHacker, Power User, SocialMedia, Web Browsers, WordPress | Leave a Comment »

Soulshow eenmalig terug op NPO Radio 2 – Nieuwsbericht – NPO Radio 2

Posted by jpluimers on 2018/12/01

“Het lijkt mij zo leuk als de Soulshow nog één keer te horen is. Ouderwets op donderdagavond”

En daar was ie dan: [WayBack] Soulshow eenmalig terug op NPO Radio 2 – Nieuwsbericht – NPO Radio 2.

Als de player niet werkt: hier is de mp3.

Via [WayBack] NPO Radio 2 on Twitter “Donderdag kwam Ferry Maat langs voor één uur lang Soulshow in @Wout2Day. Luister het hele uur hier terug: https://t.co/zo7ujYC1Cm #NPORadio2… https://t.co/lMMU4jww0R”

Wat media aandacht:

en nog meer twitter onder de handtekening..

En natuurlijk 24 uur per dag: [WayBack] Home – Soulshow Radio

Welkom op Soulshow Radio. Ferry Maat’s legendarische radioprogramma met soul-, funk- en discomuziek is 24 uur per dag te beluisteren. Kijk en luister direct op Soulshow.nl

–jeroen

Read the rest of this entry »

Posted in Audio, History, Media, Power User | Leave a Comment »

Wunschzettelaktion 2018 @ Amazon.de

Posted by jpluimers on 2018/12/01

Last day: [WayBackWunschzettelaktion 2018 @ Amazon.de

–jeroen

Posted in LifeHacker | Leave a Comment »