Skip to content

Instantly share code, notes, and snippets.

@jefgen
jefgen / diff-ICU-vs-NLS-locales-20h1.txt
Created April 7, 2021 01:08
Comparing ICU and NLS locales (on version 20h1)
diff --side-by-side --suppress-common-lines --suppress-blank-empty --ignore-case --ignore-space-change --ignore-all-space ICU-locales.txt NLS-locales.txt
All ICU Locales: | NLS Locales Note(s)
> bin Missing in MS-ICU
> bin_NG Missing in MS-ICU
bm_ML | bm_Latn
> bm_Latn_ML Handled via aliases
@jefgen
jefgen / hstring_wrapper.cs
Created March 24, 2021 23:46
HSTRING wrapper class
public class HSTRING
{
public IntPtr myString;
public HSTRING()
{
myString = IntPtr.Zero;
}
public HSTRING(IntPtr s)
@jefgen
jefgen / icu-iso8601-test.cpp
Created March 2, 2021 06:10
ICU Parsing/Formatting ISO 8601 date times
#include <windows.h>
#include <icu.h>
#include <memory>
#include <functional>
// A unique pointer with a custom deleter method for wrapping the opaque ICU objects.
template<typename T>
using deleted_unique_ptr = std::unique_ptr<T, std::function<void(T*)>>;
int wmain()
@jefgen
jefgen / usearch-test.cpp
Last active September 11, 2020 18:40
ICU-UStringSearch-Test for Pattern and Text inputs
// Simple hacky test program
//
// Output:
// Hello.
// result: 7
// result: 7
// result: -1
// result: -1
// result: -1
// done.
@jefgen
jefgen / icu4c-c4800-warnings-with-vs2019.txt
Created September 3, 2020 18:52
ICU4C: Boolean conversion warnings with VS2019 with warning 4800 enabled
"icu4c\source\common\common.vcxproj" (default target) (6) ->
(ClCompile target) ->
icu4c\source\common\rbbiscan.cpp(835,77): warning C4800: Implicit conversion from 'UBool' to bool. Possible information loss [icu4c\source\common\common.vcxproj]
icu4c\source\common\localebuilder.cpp(23,59): warning C4800: Implicit conversion from 'UBool' to bool. Possible information loss [icu4c\source\common\common.vcxproj]
icu4c\source\common\localebuilder.cpp(25,63): warning C4800: Implicit conversion from 'UBool' to bool. Possible information loss [icu4c\source\common\common.vcxproj]
icu4c\source\common\localebuilder.cpp(27,58): warning C4800: Implicit conversion from 'UBool' to bool. Possible information loss [icu4c\source\common\common.vcxproj]
icu4c\source\common\localebuilder.cpp(29,52): warning C4800: Implicit conversion from 'UBool' to bool. Possible information loss [icu4c\source\common\common.vcxproj]
icu4c\source\common\localebuilder.cpp(146,65): warning C4800: Implicit conversion from 'UBool' to bool
@jefgen
jefgen / jaera.cpp
Created August 4, 2020 04:58
Getting the Narrow Era Names from ICU, v2
#include "stdio.h"
#include "icu.h"
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#include <algorithm>
std::wstring Escape(const std::wstring& s)
@jefgen
jefgen / ICU-JaEra-NarrowNames.cpp
Created August 4, 2020 04:55
Getting the Narrow Era Names from ICU
#include "stdio.h"
#include "icu.h"
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <functional>
#include <algorithm>
std::wstring Escape(const std::wstring& s)
@jefgen
jefgen / icu-critical-section-leaks.cpp
Created May 25, 2019 02:23
Testing ICU DLL unload for leaking OS Critical Sections
// This is a simple test program to verify that ICU doesn't leak critical
// sections when the ICU library DLLs are dynamically loaded and unloaded
// from a running process.
//
// Compile and run this program under a debugger with AppVerifier enabled
// to see the output (either leaks or no leaks).
//
// Note: You need to add the path to the ICU DLL to your PATH first.
//
#include <stdio.h>
@jefgen
jefgen / buildlog.txt
Created March 23, 2019 00:37
ICU4C with MSVC with Shane's fix
1>------ Rebuild All started: Project: stubdata, Configuration: Release x64 ------
1>stubdata.cpp
1> Creating library ..\..\lib64\icudt.lib and object ..\..\lib64\icudt.exp
1>LINK : warning LNK4281: undesirable base address 0x4AD00000 for x64 image; set base address above 4GB for best ASLR optimization
1>stubdata.vcxproj -> G:\c\jefgen-icu\icu4c\source\stubdata\.\x64\Release\stubdata.dll
1>Done building project "stubdata.vcxproj".
2>------ Rebuild All started: Project: common, Configuration: Release x64 ------
2>filteredbrk.cpp
2>ubidi.cpp
2>ubiditransform.cpp
@jefgen
jefgen / dir_output.txt
Created November 20, 2018 01:26
No Python 3 on Vs2015-Server2012R2
2018-11-20T01:23:24.6132274Z Generating script.
2018-11-20T01:23:24.7173018Z ##[command]"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\592057a5-76f3-41fd-8650-437d49a875f7.cmd""
2018-11-20T01:23:52.0990732Z C:\Python27\python.exe
2018-11-20T01:23:52.1517763Z Volume in drive C has no label.
2018-11-20T01:23:52.1604984Z Volume Serial Number is 78C2-210A
2018-11-20T01:23:52.1605843Z
2018-11-20T01:23:52.1606155Z Directory of c:\
2018-11-20T01:23:52.1606315Z
2018-11-20T01:23:52.1606549Z 11/06/2018 11:15 AM <DIR> agents
2018-11-20T01:23:52.1606776Z 03/01/2017 08:16 PM <DIR> cf-cli_6.25.0_winx64